#!/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 TOR_HIDE_BROWSER_LOGO=1 export TOR_CONFIGURE_ONLY export TOR_CONTROL_PORT export TOR_CONTROL_COOKIE_AUTH_FILE export TOR_HIDE_BROWSER_LOGO 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 gksudo -u tor-launcher /usr/bin/tor-launcher RET=${?} sudo -u ${LIVE_USERNAME} xhost -SI:localuser:tor-launcher # Save ~10 RAM (due to the tmpfs) by removing this unused file rm -f /usr/Data/Browser/*.default/places.sqlite exit ${RET}