containers-tor/hidden_servicesd.sh

20 lines
359 B
Bash
Raw Normal View History

#!/bin/sh
set -e
dir=/var/empty
pid=/run/hidden_services.pid
usr=${USER:-tor}
adr=${SERVICE:-nginx}
prt=${PORT:-80}
case $1 in
start)
daemonize -c ${dir} -p ${pid} -l ${pid} -u ${usr} /usr/local/bin/syslogize /usr/bin/sutty_tor_hidden_service -S ${adr} -P ${prt}
;;
stop)
test -f ${pid} || exit 0
cat ${pid} | xargs -r kill
;;
esac