-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwol.sh
executable file
·38 lines (34 loc) · 870 Bytes
/
wol.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/sh
### BEGIN INIT INFO
# Provides: WOLbyWEB
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts & Stops My Programm
# Description: Starts & Stops My Programm
### END INIT INFO
#Switch case fuer den ersten Parameter
case "$1" in
start)
#Aktion wenn start uebergeben wird
echo "starting uwsgi WOL interface"
uwsgi /opt/WOLbyWEB/uwsgi.ini &
;;
stop)
#Aktion wenn stop uebergeben wird
echo "stopping uwsgi WOL interface (killall)"
killall uwsgi
;;
restart)
#Aktion wenn restart uebergeben wird
echo "restarting uwsgi WOL interface"
killall uwsgi
uwsgi /opt/WOLbyWEB/uwsgi.ini &
;;
*)
#Standard Aktion wenn start|stop|restart nicht passen
echo "(start|stop|restart)"
;;
esac
exit 0