#!/bin/sh # Start/stop/restart the lightweight DHCP & caching DNS server (dnsmasq) # Written for Slackware Linux by Erik Jan Tromp (with big hints from later # versions by Patrick J. Volkerding ) dnsmasq_start() { if [ -x /usr/sbin/dnsmasq -a -f /etc/dnsmasq.conf ]; then echo "Starting dnsmasq: /usr/sbin/dnsmasq" /usr/sbin/dnsmasq fi } dnsmasq_stop() { killall dnsmasq } dnsmasq_restart() { dnsmasq_stop sleep 1 dnsmasq_start } case "$1" in 'start') dnsmasq_start ;; 'stop') dnsmasq_stop ;; 'restart') dnsmasq_restart ;; *) echo "usage: $0 start|stop|restart" esac