2022-01-25 20:07:21 +00:00
|
|
|
#!/bin/sh
|
2020-10-29 02:18:29 +00:00
|
|
|
|
2022-12-29 23:08:40 +00:00
|
|
|
FF_STRING="FascistFirewall 1"
|
|
|
|
|
2022-08-01 16:54:20 +00:00
|
|
|
if [ "$WHOOGLE_TOR_SERVICE" == "0" ]; then
|
|
|
|
echo "Skipping Tor startup..."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2022-12-29 23:08:40 +00:00
|
|
|
if [ "$WHOOGLE_TOR_FF" == "1" ]; then
|
|
|
|
if (grep -q "$FF_STRING" /etc/tor/torrc); then
|
|
|
|
echo "FascistFirewall feature already enabled."
|
|
|
|
else
|
|
|
|
echo "$FF_STRING" >> /etc/tor/torrc
|
|
|
|
|
|
|
|
if [ "$?" -eq 0 ]; then
|
|
|
|
echo "FascistFirewall added to /etc/tor/torrc"
|
|
|
|
else
|
|
|
|
echo "ERROR: Unable to modify /etc/tor/torrc with $FF_STRING."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2020-10-29 02:18:29 +00:00
|
|
|
if [ "$(whoami)" != "root" ]; then
|
|
|
|
tor -f /etc/tor/torrc
|
|
|
|
else
|
2021-12-19 18:59:06 +00:00
|
|
|
if (grep alpine /etc/os-release >/dev/null); then
|
|
|
|
rc-service tor start
|
|
|
|
else
|
|
|
|
service tor start
|
|
|
|
fi
|
2020-10-29 02:18:29 +00:00
|
|
|
fi
|