diff options
author | root <root@rshg054.dnsready.net> | 2011-10-20 23:14:58 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2011-10-20 23:14:58 +0000 |
commit | 1b21445a8e9097b0bb0542ed847fbb1eb832848f (patch) | |
tree | de9d1c80c9330efe48f043d8c6cc059ad5640151 /extra/dnsmasq/rc.dnsmasq | |
parent | 1a136cf48dd7f710f38ff998182508f5a0d41c35 (diff) |
Thu Oct 20 23:14:58 UTC 2011
Diffstat (limited to 'extra/dnsmasq/rc.dnsmasq')
-rwxr-xr-x | extra/dnsmasq/rc.dnsmasq | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/extra/dnsmasq/rc.dnsmasq b/extra/dnsmasq/rc.dnsmasq index 2ded33695..0ce736ba9 100755 --- a/extra/dnsmasq/rc.dnsmasq +++ b/extra/dnsmasq/rc.dnsmasq @@ -4,6 +4,17 @@ . /etc/rc.d/functions . /etc/conf.d/dnsmasq +checkconfig() { + local testout + + if ! testout=$(/usr/sbin/dnsmasq --test 2>&1); then + echo "$testout" + return 1 + fi + + return 0 +} + pidfile=/run/dnsmasq.pid if [[ -r $pidfile ]]; then read -r PID < "$pidfile" @@ -17,7 +28,7 @@ fi case $1 in start) stat_busy "Starting DNS/DHCP daemon" - if [[ -z $PID ]] && /usr/sbin/dnsmasq --test && + if [[ -z $PID ]] && checkconfig && /usr/sbin/dnsmasq "--user=${DNSMASQ_USER:-nobody}" \ "--pid-file=$pidfile" \ "${DNSMASQ_OPTS[@]}"; then |