setup configuring browser for package installs that opt into it

This commit is contained in:
idk
2021-03-19 20:57:21 -04:00
parent 936344c794
commit 2307beb365

View File

@ -4,15 +4,18 @@
if grep '^i2psvc:' /etc/passwd; then
I2P_HOME=$(grep '^i2psvc:' /etc/passwd | sed 's|i2psvc:x:||g' | sed 's|:/usr/sbin/nologin||g' | tr -d ':1234567890' | sed 's|ip|i2p|g')
sudo -u i2psvc less $I2P_HOME/i2p-config/router.config
ROUTER_CONFIG=$(sudo -u i2psvc ls $I2P_HOME/i2p-config/router.config)
fi
installer(){
if [ -f "$I2P_HOME/i2p-config/router.config" ]; then
if [ "$0" = "/usr/local/bin/i2pconfig" ]; then
if ! grep -R 'routerconsole.browser' "$I2P_HOME/i2p-config/router.config" ; then
echo "routerconsole.browser=$0" | tee -a "$I2P_HOME/i2p-config/router.config"
if [ $(sudo -u i2psvc ls $I2P_HOME/i2p-config/router.config) ]; then
echo $I2P_HOME $ROUTER_CONFIG $0
if ! sudo -u i2psvc grep -R 'routerconsole.browser' "$I2P_HOME/i2p-config/router.config" ; then
echo "routerconsole.browser=/usr/local/bin/i2pconfig" | sudo tee -a "$I2P_HOME/i2p-config/router.config"
fi
fi
fi
}
}
installer