update tor to 0.2.0.9-alpha - includes transparent proxy support
[openwrt/svn-archive/archive.git] / net / tor / files / tor.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3 START=50
4
5 BIN=tor
6 DEFAULT=/etc/default/$BIN
7 LOG_D=/var/log/$BIN
8 LIB_D=/var/lib/$BIN
9 RUN_D=/var/run
10 PID_F=$RUN_D/$BIN.pid
11 RUN_USER=$BIN
12 RUN_GROUP=$BIN
13
14 start() {
15 [ -f $DEFAULT ] && . $DEFAULT
16 [ -d $LIB_D ] || mkdir -p $LOG_D
17 [ -d $LIB_D ] || ( mkdir -p $LIB_D && chown $RUN_USER:$RUN_GROUP $LIB_D )
18 [ -d $RUN_D ] || mkdir -p $RUN_D
19 $BIN $OPTIONS
20 }
21
22 stop() {
23 [ -f $PID_F ] && kill $(cat $PID_F)
24 }
25