forked from dsmrreader/dsmr-reader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reload.sh
executable file
·47 lines (36 loc) · 1.15 KB
/
reload.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
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Sending a HANGUP signal to Gunicorn's master process will gracefully reload its children.
echo ""
printf "%-50s" " * Reloading process: dsmr_webinterface (Gunicorn)"
if [ -f /var/tmp/gunicorn--dsmr_webinterface.pid ];
then
cat /var/tmp/gunicorn--dsmr_webinterface.pid | xargs kill -HUP
echo " [OK]"
else
echo " [??] PID file does not exist"
fi
# Management commands have some builtin mechanism for this as well.
printf "%-50s" " * Reloading process: dsmr_backend"
if [ -f /var/tmp/dsmrreader--dsmr_backend.pid ];
then
cat /var/tmp/dsmrreader--dsmr_backend.pid | xargs kill -HUP
echo " [OK]"
else
echo " [??] PID file does not exist"
fi
printf "%-50s" " * Reloading process: dsmr_datalogger"
if [ -f /var/tmp/dsmrreader--dsmr_datalogger.pid ];
then
cat /var/tmp/dsmrreader--dsmr_datalogger.pid | xargs kill -HUP
echo " [OK]"
else
echo " [??] PID file does not exist"
fi
printf "%-50s" " * Reloading process: dsmr_mqtt"
if [ -f /var/tmp/dsmrreader--dsmr_mqtt.pid ];
then
cat /var/tmp/dsmrreader--dsmr_mqtt.pid | xargs kill -HUP
echo " [OK]"
else
echo " [??] PID file does not exist"
fi