-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
BIN=tor
DEFAULT=/etc/default/$BIN
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
-case $1 in
- start)
- mkdir -p $LOG_D
- mkdir -p $RUN_D
- $BIN $OPTIONS
- ;;
- stop)
- [ -f $PID_F ] && kill $(cat $PID_F)
- ;;
- *)
- echo "usage: $0 (start|stop)"
- exit 1
-esac
+start() {
+ mkdir -p $LOG_D
+ mkdir -p $RUN_D
+ $BIN $OPTIONS
+}
+
+stop() {
+ [ -f $PID_F ] && kill $(cat $PID_F)
+}
-exit $?