mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
fb18e34a07
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
43 lines
808 B
Bash
43 lines
808 B
Bash
#!/bin/sh
|
|
|
|
# rc.quagga will try to start any service that has configured a config file in /etc/quagga
|
|
|
|
start() {
|
|
|
|
for SERVICE in zebra bgpd isisd ospfd ospf6d pimd ripd ripngd nhrpd; do
|
|
if [ -r /etc/quagga/$SERVICE.conf ] ; then
|
|
echo -n "Starting ${SERVICE}: " && /usr/sbin/${SERVICE} -d && echo "done"
|
|
fi
|
|
done
|
|
}
|
|
|
|
stop() {
|
|
|
|
for SERVICE in zebra bgpd isisd ospfd ospf6d pimd ripd ripngd nhrpd; do
|
|
echo -n "Stopping ${SERVICE}: "
|
|
killall $SERVICE 2>/dev/null && echo -n "done" || echo -n "not started"
|
|
echo
|
|
done
|
|
}
|
|
|
|
restart() {
|
|
|
|
stop && sleep 2s && start
|
|
if [ -x /etc/rc.d/rc.watchquagga ] ; then
|
|
sh /etc/rc.d/rc.watchquagga restart
|
|
fi
|
|
}
|
|
|
|
case "$1" in
|
|
'start')
|
|
start
|
|
;;
|
|
'stop')
|
|
stop
|
|
;;
|
|
'restart')
|
|
restart
|
|
;;
|
|
*)
|
|
echo "usage $0 start|stop|restart"
|
|
esac
|