81 lines
2.2 KiB
Bash
Executable File
81 lines
2.2 KiB
Bash
Executable File
#!/bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: untorify
|
|
# Required-Start: $remote_fs
|
|
# Required-Stop: $remote_fs
|
|
# Default-Start: 3 4 5
|
|
# Default-Stop: 0 1 2 6
|
|
# X-Start-After: resolvconf
|
|
# Short-Description: Clear proxy modifications done by Tails to enable VPN/SSH capabilities or direct connection.
|
|
### END INIT INFO
|
|
#
|
|
# Author: czesiek
|
|
#
|
|
|
|
set -e
|
|
|
|
NAME=untorify
|
|
DESC=untorify
|
|
|
|
case "$1" in
|
|
start)
|
|
echo -n "Starting $DESC: "
|
|
|
|
# delete apt's proxy config
|
|
rm -rf /etc/apt/apt.conf.d/0000runtime-proxy
|
|
|
|
# overwrite /etc/environment with out modified one
|
|
cp /etc/environment.clean /etc/environment
|
|
|
|
# delete Iceweasel's wrapper script
|
|
#rm -rf /usr/local/bin/iceweasel
|
|
rm -rf /usr/local/bin/tor-browser # XXX: Not tested
|
|
|
|
# FIXME
|
|
## switch Iceweasel's default profile for Debian's clean one
|
|
#mv /etc/iceweasel/profile /etc/iceweasel/profile.tails
|
|
#mv /etc/iceweasel/profile.clean /etc/iceweasel/profile
|
|
|
|
# move the default ~/.mozilla
|
|
# live-config starts before us
|
|
mv /etc/skel/.mozilla /etc/skel/.mozilla.tails
|
|
# so we need this
|
|
rm -rf /home/amnesia/.mozilla
|
|
|
|
# FIXME
|
|
## TODO: /opt/yokai cleanup
|
|
#FILE=/usr/lib/iceweasel/browser/defaults/preferences/000-tor-browser.js
|
|
#sed -r -i '/^(user_|)pref\("network\.proxy\..*",/d' ${FILE}
|
|
#echo 'user_pref("network.proxy.type", 0);' >> ${FILE}
|
|
#echo 'user_pref("network.proxy.socks_remote_dns", false);' >> ${FILE}
|
|
#
|
|
#FILE=/usr/lib/iceweasel/browser/defaults/syspref/000-tor-browser.js
|
|
#sed -r -i '/^(user_|)pref\("network\.proxy\..*",/d' ${FILE}
|
|
#echo 'user_pref("network.proxy.type", 0);' >> ${FILE}
|
|
#echo 'user_pref("network.proxy.socks_remote_dns", false);' >> ${FILE}
|
|
|
|
# resolvconf
|
|
echo '' > /etc/resolvconf/resolv.conf.d/base
|
|
echo -e 'tun*\n*' > /etc/resolvconf/interface-order
|
|
|
|
# delete NetworkManager dispatcher scripts
|
|
rm /etc/NetworkManager/dispatcher.d/10-tor.sh
|
|
rm /etc/NetworkManager/dispatcher.d/20-time.sh
|
|
rm /etc/NetworkManager/dispatcher.d/60-tor-ready-notification.sh
|
|
rm /etc/NetworkManager/dispatcher.d/60-ttdnsd.sh
|
|
rm /etc/NetworkManager/dispatcher.d/60-vidalia.sh
|
|
|
|
# ssh client
|
|
rm /etc/ssh/ssh_config
|
|
|
|
echo "Done"
|
|
;;
|
|
*)
|
|
N=/etc/init.d/$NAME
|
|
echo "Usage: $N {start}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|