tails-tor-launcher 1002 Bytes
Newer Older
1 2 3 4
#!/bin/sh

set -e

5 6 7
# Import export_gnome_env().
. /usr/local/lib/tails-shell-library/gnome.sh

8 9 10 11 12
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
13
TOR_HIDE_BROWSER_LOGO=1
14 15 16
export TOR_CONFIGURE_ONLY
export TOR_CONTROL_PORT
export TOR_CONTROL_COOKIE_AUTH_FILE
17
export TOR_HIDE_BROWSER_LOGO
18 19 20 21 22 23 24 25 26 27 28 29

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

30
until pgrep -u "${LIVE_USERNAME}" '^ibus-daemon' >/dev/null ; do
31 32 33 34
   sleep 5
done

export LANG
35
export_gnome_env
36
sudo -u ${LIVE_USERNAME} xhost +SI:localuser:tor-launcher
37
gksudo -u tor-launcher /usr/bin/tor-launcher
38 39 40
RET=${?}
sudo -u ${LIVE_USERNAME} xhost -SI:localuser:tor-launcher

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

44
exit ${RET}