let ipkg fail when a package file to be installed is not found
[openwrt/svn-archive/archive.git] / openwrt / package / tor / files / tor.init
1 #!/bin/sh
2
3 BIN=tor
4 DEFAULT=/etc/default/$BIN
5 LOG_D=/var/log/$BIN
6 RUN_D=/var/run
7 PID_F=$RUN_D/$BIN.pid
8 [ -f $DEFAULT ] && . $DEFAULT
9
10 case $1 in
11 start)
12 mkdir -p $LOG_D
13 mkdir -p $RUN_D
14 $BIN $OPTIONS
15 ;;
16 stop)
17 [ -f $PID_F ] && kill $(cat $PID_F)
18 ;;
19 *)
20 echo "usage: $0 (start|stop)"
21 exit 1
22 esac
23
24 exit $?