1#!/bin/sh 2 3[ -f /etc/dnsmasq.conf ] || exit 0 4 5case "$1" in 6 start) 7 printf "Starting dnsmasq: " 8 start-stop-daemon -S -x /usr/sbin/dnsmasq 9 [ $? = 0 ] && echo "OK" || echo "FAIL" 10 ;; 11 stop) 12 printf "Stopping dnsmasq: " 13 start-stop-daemon -K -q -x /usr/sbin/dnsmasq 14 [ $? = 0 ] && echo "OK" || echo "FAIL" 15 ;; 16 restart|reload) 17 $0 stop 18 $0 start 19 ;; 20 *) 21 echo "Usage: $0 {start|stop|restart}" 22 exit 1 23esac 24 25exit 0 26