Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
boot()
{
BOOT=1
start "$@"
}
start_service() {
local instance="$1"
local instance_found=0
[ -n "$BOOT" ] && return
. /lib/functions/network.sh
config_cb() {
local type="$1"
local name="$2"
if [ "$type" = "dnsmasq" ]; then
if [ -n "$instance" -a "$instance" = "$name" ]; then
instance_found=1
fi
fi
}
config_load dhcp
if [ -n "$instance" ]; then
[ "$instance_found" -gt 0 ] || return
dnsmasq_start "$instance"
else
config_foreach dnsmasq_start dnsmasq
fi
}
reload_service() {
rc_procd start_service "$@"
return 0
}
stop_service() {
local instance="$1"
local instance_found=0
config_cb() {
local type="$1"
local name="$2"
if [ "$type" = "dnsmasq" ]; then
if [ -n "$instance" -a "$instance" = "$name" ]; then
instance_found=1
fi
fi
config_load dhcp
if [ -n "$instance" ]; then
[ "$instance_found" -gt 0 ] || return
dnsmasq_stop "$instance"
else
config_foreach dnsmasq_stop dnsmasq
fi