2014-11-02 21:14:36 +00:00
|
|
|
#!/bin/bash
|
2014-10-29 16:53:35 +00:00
|
|
|
|
2014-11-02 21:14:36 +00:00
|
|
|
. /usr/lib/whonix/utility_functions
|
2014-10-29 16:53:35 +00:00
|
|
|
|
2014-11-14 00:13:51 +00:00
|
|
|
if ! [ "${WHONIX}" == "template" ]; then
|
|
|
|
sudo /usr/lib/whonix/bind-dirs.sh
|
|
|
|
fi
|
|
|
|
|
2014-11-02 21:14:36 +00:00
|
|
|
if [ "${WHONIX}" == "gateway" ]; then
|
2014-11-14 00:13:51 +00:00
|
|
|
if grep "^DisableNetwork 0$" /etc/tor/torrc ;then
|
|
|
|
sudo service sdwdate restart
|
|
|
|
sudo service tor restart
|
|
|
|
else
|
2014-11-02 21:14:36 +00:00
|
|
|
sudo service sdwdate restart
|
|
|
|
sudo service tor stop
|
2014-11-14 00:13:51 +00:00
|
|
|
sudo /usr/bin/whonixsetup
|
|
|
|
fi
|
2014-11-02 21:14:36 +00:00
|
|
|
|
|
|
|
elif [ "${WHONIX}" == "workstation" ]; then
|
2014-11-14 00:13:51 +00:00
|
|
|
sudo service sdwdate restart
|
2014-11-02 21:14:36 +00:00
|
|
|
if ! [ -f "/var/lib/whonix/do_once/whonixsetup.done" ]; then
|
|
|
|
sudo /usr/bin/whonixsetup
|
|
|
|
fi
|
|
|
|
|
|
|
|
elif [ "${WHONIX}" == "template" -a "${PROXY_SECURE}" == "0" ]; then
|
2014-11-11 18:41:42 +00:00
|
|
|
# Set secure defaults.
|
2014-11-14 00:13:51 +00:00
|
|
|
sudo iptables -P INPUT DROP
|
|
|
|
sudo iptables -P FORWARD DROP
|
|
|
|
sudo iptables -P OUTPUT DROP
|
2014-11-11 18:41:42 +00:00
|
|
|
|
|
|
|
# Flush old rules.
|
2014-11-14 00:13:51 +00:00
|
|
|
sudo iptables -F
|
|
|
|
sudo iptables -X
|
|
|
|
sudo iptables -t nat -F
|
|
|
|
sudo iptables -t nat -X
|
|
|
|
sudo iptables -t mangle -F
|
|
|
|
sudo iptables -t mangle -X
|
2014-11-11 18:41:42 +00:00
|
|
|
|
|
|
|
# Display warning that netvm is not connected to a torvm
|
2014-11-02 21:14:36 +00:00
|
|
|
/usr/lib/whonix/alert update /usr/lib/whonix/messages.yaml
|
|
|
|
fi
|