mirror of
git://slackware.nl/current.git
synced 2024-12-29 10:25:00 +01:00
37 lines
512 B
Text
37 lines
512 B
Text
|
#!/bin/sh
|
||
|
# Start/stop/restart dnsmasq (a small DNS/DHCP server):
|
||
|
|
||
|
# Start dnsmasq:
|
||
|
dnsmasq_start() {
|
||
|
if [ -x /usr/sbin/dnsmasq ]; then
|
||
|
echo "Starting dnsmasq: /usr/sbin/dnsmasq"
|
||
|
/usr/sbin/dnsmasq
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
# Stop dnsmasq:
|
||
|
dnsmasq_stop() {
|
||
|
killall dnsmasq
|
||
|
}
|
||
|
|
||
|
# Restart dnsmasq:
|
||
|
dnsmasq_restart() {
|
||
|
dnsmasq_stop
|
||
|
sleep 1
|
||
|
dnsmasq_start
|
||
|
}
|
||
|
|
||
|
case "$1" in
|
||
|
'start')
|
||
|
dnsmasq_start
|
||
|
;;
|
||
|
'stop')
|
||
|
dnsmasq_stop
|
||
|
;;
|
||
|
'restart')
|
||
|
dnsmasq_restart
|
||
|
;;
|
||
|
*)
|
||
|
echo "usage rc.dnsmasq: start|stop|restart"
|
||
|
esac
|