]> git.ipfire.org Git - ipfire.org.git/commitdiff
Add initscript for webapp.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 30 Jan 2010 14:48:00 +0000 (15:48 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 30 Jan 2010 14:48:00 +0000 (15:48 +0100)
www/webapp.init [new file with mode: 0755]

diff --git a/www/webapp.init b/www/webapp.init
new file mode 100755 (executable)
index 0000000..8b8e459
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+HOMEDIR=$(dirname $(readlink $0))
+LOGFILE=/srv/logs/www/webapp.error.log
+
+case "$1" in
+       start)
+               cd ${HOMEDIR} && ./webapp.py >>${LOGFILE} 2>&1 &
+               ;;
+
+       stop)
+               killall webapp.py
+               ;;
+
+       restart)
+               $0 stop
+               sleep 2
+               $0 start
+               ;;
+
+       check)
+               if (ps aux | grep -q webapp.py); then
+                       : # Process is running...
+               else
+                       $0 restart
+               fi
+               ;;
+esac