2013-02-10 16:25:51 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
start() {
|
2018-03-27 10:10:34 +02:00
|
|
|
if [ -x /usr/bin/nasd ]; then
|
|
|
|
if [ -n "$(pgrep -x nasd)" ]; then
|
|
|
|
echo "Starting nasd /usr/bin/nasd"
|
|
|
|
/usr/bin/nasd :0 -aa -b
|
|
|
|
else
|
|
|
|
echo "nasd is already running"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2013-02-10 16:25:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2018-03-27 10:10:34 +02:00
|
|
|
pkill -x nasd
|
2013-02-10 16:25:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
restart() {
|
2018-03-27 10:10:34 +02:00
|
|
|
stop
|
|
|
|
sleep 1
|
|
|
|
start
|
2013-02-10 16:25:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
2018-03-27 10:10:34 +02:00
|
|
|
'start')
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
'stop')
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
'restart')
|
|
|
|
restart
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "usage $0 start|stop|restart"
|
|
|
|
;;
|
2013-02-10 16:25:51 +01:00
|
|
|
esac
|
|
|
|
|