2 #universal daemon controller
7 daemonid
="busybox-httpd" #arch-style daemon identification
8 binary
="/usr/bin/busybox-httpd" #daemon binary
9 pidfile
="/var/run/$daemonid.pid" #maybe you don't need to change this...
10 description
="BusyBox HTTP Daemon" #daemon description...
12 PID
=$
(cat "$pidfile" 2>/dev
/null
);
16 stat_busy
"Starting $description"
17 [ -z "$PID" ] && "$binary" "$pidfile" 2>&1
21 add_daemon
"$daemonid"
26 stat_busy
"Stopping $description"
27 [ ! -z "$PID" ] && kill $PID &>/dev
/null
43 echo "usage: $0 {start|stop|restart}"