2010-04-13 01:34:18 +02:00
|
|
|
#!/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..."
|
2011-02-05 18:18:48 +01:00
|
|
|
kill $(cat $PIDFILE)
|
2010-04-13 01:34:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|