dingo 725f30e728 [patch-team] - tor-alpha new package - Signed-off-by: Jacob Appelbaum <jacob@appelbaum.net>
git-svn-id: svn://svn.openwrt.org/openwrt/packages@24656 3c298f89-4303-0410-b956-a3cf2f4a3e73
2010-12-18 02:01:59 +00:00

27 lines
589 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 $LOG_D ] || ( mkdir -m 0755 -p $LOG_D && chown $RUN_USER:$RUN_GROUP $LOG_D )
[ -d $LIB_D ] || ( mkdir -m 0700 -p $LIB_D && chown $RUN_USER:$RUN_GROUP $LIB_D )
[ -d $RUN_D ] || mkdir -p $RUN_D
[ -f $PID_F ] || ( touch $PID_F && chown $RUN_USER:$RUN_GROUP $PID_F )
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
}