Commit 6bea8c1c authored by kytv's avatar kytv
Browse files

Use dpkg-divert to prevent overwriting i2prouter on upgrade

/usr/bin/i2prouter is not used in Tails so we replace it with a stub
script. dpkg-divert will ensure that our custom script isn't
overwritten if a user upgrades the I2P packages manually.
parent be40a174
...@@ -5,11 +5,28 @@ set -e ...@@ -5,11 +5,28 @@ set -e
echo "Configuring I2P" echo "Configuring I2P"
I2P="/usr/share/i2p" I2P="/usr/share/i2p"
I2PROUTER="/usr/bin/i2prouter"
WRAPPER="/etc/i2p/wrapper.config" WRAPPER="/etc/i2p/wrapper.config"
# This must be set in order for the i2p init script to work # This must be set in order for the i2p init script to work
sed -i 's/^RUN_DAEMON=.*$/RUN_DAEMON="true"/' /etc/default/i2p sed -i 's/^RUN_DAEMON=.*$/RUN_DAEMON="true"/' /etc/default/i2p
echo "Removing $I2PROUTER"
dpkg-divert --rename --add "$I2PROUTER"
# Remove the "i2prouter" script, its man page, and its apparmor profile
# since these are not used by Tails:
rm /etc/apparmor.d/usr.bin.i2prouter /usr/share/man/man1/i2prouter.1.gz
# Install custom i2prouter stub script
cat > "$I2PROUTER" << EOF
#!/bin/sh
echo "This script is not used by Tails."
echo "See https://tails.boum.org/doc/anonymous_internet/i2p/ for more information."
exit 0
EOF
chmod 755 "$I2PROUTER"
# Remove the outproxy from the tunnel on port 4444 # Remove the outproxy from the tunnel on port 4444
# This will remove the following lines: # This will remove the following lines:
# tunnel.0.proxyList=false.i2p # tunnel.0.proxyList=false.i2p
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment