summaryrefslogtreecommitdiff
path: root/www/tclhttpd/files/tclhttpd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'www/tclhttpd/files/tclhttpd.sh')
-rw-r--r--www/tclhttpd/files/tclhttpd.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/www/tclhttpd/files/tclhttpd.sh b/www/tclhttpd/files/tclhttpd.sh
new file mode 100644
index 000000000000..bba81a73cb35
--- /dev/null
+++ b/www/tclhttpd/files/tclhttpd.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+PID_FILE=/var/run/tclhttpd.pid
+case $1 in
+ stop)
+ if [ -e $PID_FILE ] ; then
+ PID=`cat $PID_FILE`
+ if kill $PID ; then
+ exec rm -f $PID_FILE
+ fi
+ else
+ echo "No $PID_FILE presenet, tclhttpd is, probably, not running" > /dev/stderr
+ fi
+ ;;
+ ''|start)
+ COMMAND_LINE &
+ sleep 2
+ if kill -0 $! ; then
+ echo -n ' tclhttpd'
+ echo $! > $PID_FILE
+ else
+ exec logger -s "tclhttpd failed to start"
+ fi
+ ;;
+esac