packages/net/tor/files/tor.init
olli e12cdb0b84 tor: fix tor init script (#2279)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@8532 3c298f89-4303-0410-b956-a3cf2f4a3e73
2007-08-28 17:09:49 +00:00

26 lines
460 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
BIN=tor
DEFAULT=/etc/default/$BIN
LOG_D=/var/log/$BIN
LIB_D=/var/lib/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
RUN_USER=$BIN
RUN_GROUP=$BIN
start() {
[ -f $DEFAULT ] && . $DEFAULT
[ -d $LIB_D ] || mkdir -p $LOG_D
[ -d $LIB_D ] || ( mkdir -p $LIB_D && chown $RUN_USER:$RUN_GROUP $LIB_D )
[ -d $RUN_D ] || mkdir -p $RUN_D
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
}