diff options
author | Nicolas Thill <nico@openwrt.org> | 2011-11-07 22:58:45 +0000 |
---|---|---|
committer | Nicolas Thill <nico@openwrt.org> | 2011-11-07 22:58:45 +0000 |
commit | a13b6db678741695b029f0968e5253a85b70cf83 (patch) | |
tree | 6bbde0c690bf7ca691ec018b1397b0ca0c2b4d63 /package/dnsmasq/files/dnsmasq.init | |
parent | 8b21997f14a67fdf4e9f4e0171d187feebccea2f (diff) | |
download | master-187ad058-a13b6db678741695b029f0968e5253a85b70cf83.tar.gz master-187ad058-a13b6db678741695b029f0968e5253a85b70cf83.tar.bz2 master-187ad058-a13b6db678741695b029f0968e5253a85b70cf83.zip |
package/dnsmasq: use new service wrapper
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28837 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/dnsmasq/files/dnsmasq.init')
-rw-r--r-- | package/dnsmasq/files/dnsmasq.init | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init index 3d9060d81d..80ab250baa 100644 --- a/package/dnsmasq/files/dnsmasq.init +++ b/package/dnsmasq/files/dnsmasq.init @@ -2,6 +2,9 @@ # Copyright (C) 2007 OpenWrt.org START=60 + +SERVICE_USE_PID=1 + DNS_SERVERS="" DOMAIN="" @@ -397,7 +400,7 @@ start() { config_foreach dhcp_add dhcp config_foreach dhcp_cname_add cname - /usr/sbin/dnsmasq $args && { + service_start /usr/sbin/dnsmasq $args && { rm -f /tmp/resolv.conf [ -n "$DOMAIN" ] && echo "search $DOMAIN" >> /tmp/resolv.conf DNS_SERVERS="$DNS_SERVERS 127.0.0.1" @@ -408,10 +411,10 @@ start() { } stop() { - [ -f /tmp/resolv.conf ] && { - rm -f /tmp/resolv.conf - ln -s /tmp/resolv.conf.auto /tmp/resolv.conf + service_stop /usr/sbin/dnsmasq && { + [ -f /tmp/resolv.conf ] && { + rm -f /tmp/resolv.conf + ln -s /tmp/resolv.conf.auto /tmp/resolv.conf + } } - service_kill dnsmasq /var/run/dnsmasq.pid - return 0 } |