tails-tor-launcher 1004 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
#!/bin/sh

set -e

unset TOR_CONTROL_PASSWD
unset TOR_FORCE_NET_CONFIG
TOR_CONFIGURE_ONLY=1
TOR_CONTROL_PORT=9051
TOR_CONTROL_COOKIE_AUTH_FILE=/var/run/tor/control.authcookie
10
TOR_HIDE_BROWSER_LOGO=1
11 12 13
export TOR_CONFIGURE_ONLY
export TOR_CONTROL_PORT
export TOR_CONTROL_COOKIE_AUTH_FILE
14
export TOR_HIDE_BROWSER_LOGO
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

if echo "$@" | grep -qw -- --force-net-config; then
    TOR_FORCE_NET_CONFIG=1
    export TOR_FORCE_NET_CONFIG
fi

# Get LIVE_USERNAME
. /etc/live/config.d/username.conf

# Get LANG
. /etc/default/locale

until pgrep -u "${LIVE_USERNAME}" nm-applet >/dev/null ; do
   sleep 5
done

export LANG
export DISPLAY=':0.0'
export XAUTHORITY="`echo /var/run/gdm3/auth-for-${LIVE_USERNAME}-*/database`"
sudo -u ${LIVE_USERNAME} xhost +SI:localuser:tor-launcher
35
gksudo -u tor-launcher /usr/bin/tor-launcher
36 37 38
RET=${?}
sudo -u ${LIVE_USERNAME} xhost -SI:localuser:tor-launcher

39
# Save ~10 RAM (due to the tmpfs) by removing this unused file
40
rm -f /usr/Data/Browser/*.default/places.sqlite
41

42
exit ${RET}