]> git.ipfire.org Git - ipfire.org.git/blame - www/webapp.init
Merge branch 'master' of ssh://earl@git.ipfire.org/pub/git/ipfire.org
[ipfire.org.git] / www / webapp.init
CommitLineData
7a5b97a0
MT
1#!/bin/bash
2
3HOMEDIR=$(dirname $(readlink $0))
4LOGFILE=/srv/logs/www/webapp.error.log
5
6case "$1" in
7 start)
858d8259
JPT
8 if ps ax | grep -v grep | grep webapp.py > /dev/null
9 then
10 echo "webapp is allready running..."
11 else
12 echo "Starting webapp..."
13 cd ${HOMEDIR} && ./webapp.py >>${LOGFILE} 2>&1 &
14 fi
7a5b97a0
MT
15 ;;
16
17 stop)
858d8259
JPT
18 if ps ax | grep -v grep | grep webapp.py > /dev/null
19 then
20 echo "Stopping webapp..."
21 killall webapp.py &> /dev/null
22 else
23 echo "webapp is not running..."
24 fi
7a5b97a0
MT
25 ;;
26
27 restart)
28 $0 stop
29 sleep 2
30 $0 start
31 ;;
32
33 check)
858d8259
JPT
34 if ps ax | grep -v grep | grep webapp.py > /dev/null
35 then
36 echo "webapp is running..."
7a5b97a0 37 else
858d8259
JPT
38 echo "webapp is not running!"
39 $0 start
40 fi
41 ;;
42
43 *)
44 echo "usage: webapp [ start | stop | restart | check ]"
7a5b97a0 45 ;;
858d8259 46
7a5b97a0 47esac