2005-06-17 09:22:46 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2005-10-19 03:16:27 +03:00
|
|
|
BIN=mini_httpd
|
|
|
|
DEFAULT=/etc/default/$BIN
|
2005-06-17 09:22:46 +03:00
|
|
|
RUN_D=/var/run
|
2005-10-19 03:16:27 +03:00
|
|
|
PID_F=$RUN_D/$BIN.pid
|
2005-06-17 09:22:46 +03:00
|
|
|
[ -f $DEFAULT ] && . $DEFAULT
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
start)
|
|
|
|
[ -d $RUN_D ] || mkdir -p $RUN_D
|
2005-10-19 03:16:27 +03:00
|
|
|
$BIN $OPTIONS 2>/dev/null
|
2005-06-17 09:22:46 +03:00
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
[ -f $PID_F ] && kill $(cat $PID_F)
|
|
|
|
;;
|
2005-10-19 03:16:27 +03:00
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
$0 start
|
|
|
|
;;
|
2005-06-17 09:22:46 +03:00
|
|
|
*)
|
2005-10-19 03:16:27 +03:00
|
|
|
echo "usage: $0 (start|stop|restart)"
|
2005-06-17 09:22:46 +03:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit $?
|