#!/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 export TOR_CONFIGURE_ONLY export TOR_CONTROL_PORT export TOR_CONTROL_COOKIE_AUTH_FILE 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 sudo -n -H -u tor-launcher /usr/bin/tor-launcher RET=${?} sudo -u ${LIVE_USERNAME} xhost -SI:localuser:tor-launcher exit ${RET}