summaryrefslogtreecommitdiffstats
path: root/network/openvas-administrator/rc.openvasad
blob: 78f167a47f515e4253238f3a0b3d29797a023874 (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
#!/bin/sh

# Get OpenVAS options
. /etc/rc.d/rc.openvas.conf

PIDFILE="/var/run/openvasad.pid"

start() {
  echo "Starting OpenVAS administrator..."
  openvasad --port=${ADM_PORT} ${ADM_OPTIONS}
}

stop() {
  echo "Stopping OpenVAS administrator..."
  kill `cat $PIDFILE`
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    sleep 1
    start
    ;;
  *)
    echo "Usage: $0 (start|stop|restart)"
esac