-
Notifications
You must be signed in to change notification settings - Fork 0
/
Route53DynUpdate
executable file
·52 lines (45 loc) · 1.14 KB
/
Route53DynUpdate
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
48
49
50
51
52
#!/sbin/openrc-run
# Catch script Output when in Debug mode
CatchOutput=False
depend() {
need net
}
checkconfig() {
# Verify that the configuration file exists
if [ ! -f /etc/network/Route53DynUpdate.ini ]; then
eerror "Route53DynUpdate Configuration file /etc/network/Route53DynUpdate.ini doesn't exist"
return 1
else
if grep "Debug=True" /etc/network/Route53DynUpdate.ini &> /dev/null
then
CatchOutput=True
fi
fi
}
start() {
checkconfig || return 1
ebegin "Starting Route53DynUpdate"
if [ $CatchOutput = True ]
then
/opt/bin/Route53DynUpdate.py > /var/log/Route53DynUpdate.stdout.log 2> /var/log/Route53DynUpdate.stderr.log
else
/opt/bin/Route53DynUpdate.py
fi
eend $?
}
stop() {
PID=$(cat "/run/Route53DynUpdate.pid" 2>/dev/null)
if [ -z "${PID}" ]; then
einfo "Route53DynUpdate not running (no pid file)"
return 0
fi
ebegin "Stopping Route53DynUpdate"
if ! kill $PID > /dev/null 2>&1; then
einfo "Could not send SIGTERM to process $PID" >&2
fi
eend $?
}
restart() {
stop
start
}