2017-01-26 19:20:37 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Entrypoint script for tor-browser.
|
|
|
|
#
|
|
|
|
set -euo pipefail
|
|
|
|
|
2017-01-27 04:45:29 +00:00
|
|
|
# If TORRC_PATH is set in the environment, use the torrc file
|
|
|
|
# specified by that path instead of the default config.
|
2017-01-26 19:20:37 +00:00
|
|
|
TORRC_PATH=${TORRC_PATH:-""}
|
2017-01-27 04:45:29 +00:00
|
|
|
if [[ "$TORRC_PATH" ]]; then
|
|
|
|
echo "$(date) [ $(basename $0) ] Using torrc file from '$TORRC_PATH'.."
|
|
|
|
if [[ ! -e "$TORRC_PATH" ]]; then
|
|
|
|
echo "$(date) [ $(basename $0) ] FATAL: No such file '$TORRC_PATH'." >&1
|
|
|
|
exit 1
|
|
|
|
fi
|
2017-01-27 04:49:58 +00:00
|
|
|
cp -v "$TORRC_PATH" /usr/local/bin/Browser/TorBrowser/Data/Tor/torrc
|
2017-01-27 04:45:29 +00:00
|
|
|
fi
|
|
|
|
|
2017-01-27 05:41:17 +00:00
|
|
|
echo "$(date) [ $(basename $0) ] Starting tor-browser with extra args '$@'.."
|
2017-01-26 19:20:37 +00:00
|
|
|
start-tor-browser "$@"
|
2017-01-27 05:41:17 +00:00
|
|
|
echo "$(date) [ $(basename $0) ] The tor-browser process exited."
|