summaryrefslogtreecommitdiff
path: root/network/greenbone-security-assistant/rc.gsad
blob: 9ed7614a7041e735515f673aecd94c951fa57259 (plain)
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/sh
#
# /etc/rc.d/rc.gsad
#
# Start/stop/restart the Greenbone Security Assistant Daemon.
#
# To make Greenbone SA start automatically at boot, make this
# file executable:  chmod 755 /etc/rc.d/rc.gsad
# and add to rc.local:
# if [ -x /etc/rc.d/rc.gsad ]; then
#   . /etc/rc.d/rc.gsad start
# fi
#

GSAD_PATH=/usr/sbin
GSAD_BIN=gsad
GSAD_OPTIONS="-p 9392 --timeout=60 --gnutls-priorities=SECURE128:-VERS-SSL3.0"
GSAD_CMD="$GSAD_PATH/$GSAD_BIN $GSAD_OPTIONS"

gsad_start() {
  echo Starting Greenbone Security Assistant: $GSAD_CMD
  $GSAD_CMD
}

gsad_stop() {
  echo "Stopping Greenbone Security Assistant"
  /bin/killall $GSAD_BIN
}

gsad_restart() {
  gsad_stop
  gsad_start
}

case "$1" in
'start')
  gsad_start
  ;;
'stop')
  gsad_stop
  ;;
'restart')
  gsad_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac