/
swamp-threadfix-service
executable file
·55 lines (48 loc) · 1.13 KB
/
swamp-threadfix-service
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
53
54
55
#!/bin/bash
# This file is subject to the terms and conditions defined in
# 'LICENSE.txt', which is part of this source code distribution.
#
# Copyright 2012-2016 Software Assurance Marketplace
# chkconfig: 3 99 25
# description: swamp mysqldump on shutdown
RUNOUT=/mnt/out/run.out
NAME="$(basename $0)"
if [ "${NAME:0:1}" = "S" -o "${NAME:0:1}" = "K" ]; then
NAME="${NAME:3}"
fi
stop() {
echo "`date`: Stopping $0 with dump of threadfix db"
echo "`date`: Stopping $0 with dump of threadfix db" >> $RUNOUT 2>&1
/mnt/in/threadfix_viewerdb.sh
rm -f /var/lock/subsys/$NAME
}
start() {
echo "`date` Starting $0 for subsys lock" >> $RUNOUT 2>&1
touch /var/lock/subsys/$NAME
}
status() {
echo "No daemon runs as part of this service"
echo "The service establishes the lock file at startup"
echo "The service executes mysqldump for threadfix database"
if [ -r /var/lock/subsys/$NAME ]; then
echo "`date` /var/lock/subsys/$NAME lock found"
else
echo "`date` /var/lock/subsys/$NAME lock not found"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
*)
echo $"Usage: $0 {stop}"
RETVAL=1
;;
esac
exit 0