whoogle-search/misc/tor/start-tor.sh
Ben Busby 96b9cce70c
Use WHOOGLE_TOR_SERVICE to enable/disable bg Tor service
Allows skipping the Tor startup script if WHOOGLE_TOR_SERVICE is set to
0. This is separate from WHOOGLE_CONFIG_TOR, which only allows
enabling/disabling user configuration of passing searches through
Tor.

Closes #631
2022-08-01 10:54:20 -06:00

17 lines
298 B
Bash
Executable File

#!/bin/sh
if [ "$WHOOGLE_TOR_SERVICE" == "0" ]; then
echo "Skipping Tor startup..."
exit 0
fi
if [ "$(whoami)" != "root" ]; then
tor -f /etc/tor/torrc
else
if (grep alpine /etc/os-release >/dev/null); then
rc-service tor start
else
service tor start
fi
fi