Commit e654c92c authored by Tails developers's avatar Tails developers

Add start script for tor-launcher.

parent b429f7f2
Defaults!/usr/bin/tor-launcher env_keep+="TOR_CONFIGURE_ONLY TOR_CONTROL_PORT TOR_CONTROL_COOKIE_AUTH_FILE TOR_FORCE_NET_CONFIG"
root ALL = (tor-launcher) NOPASSWD: /usr/bin/tor-launcher
amnesia ALL = (root) NOPASSWD: /usr/local/sbin/tails-tor-launcher
#!/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}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment