summaryrefslogtreecommitdiff
path: root/network/openvas-manager/rc.openvasmd
blob: 0a89f4e1b7c66ef0603946f37555678fae1e98ea (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
48
49
50
51
52
53
#!/bin/sh

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

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

start() {
  echo "Starting OpenVAS manager..."
  openvasmd --port=${MAN_PORT} --sport=${SCA_PORT} ${MAN_OPTIONS}
}

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

update() {
  openvasmd --sport=${SCA_PORT} --update
}

rebuild() {
  openvasmd --sport=${SCA_PORT} --rebuild
}

migrate() {
  openvasmd --sport=${SCA_PORT} --migrate
}

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