1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-07-08 08:08:06 +00:00

Merge pull request #798 from pi-hole/dnsmasqrestartchange

Some bug fixes before release
This commit is contained in:
Adam Warner 2016-10-16 17:25:30 +01:00 committed by GitHub
commit 123b16991b
4 changed files with 44 additions and 21 deletions

View File

@ -172,11 +172,19 @@ Reload() {
if [[ ${dnsmasqPid} ]]; then if [[ ${dnsmasqPid} ]]; then
# service already running - reload config # service already running - reload config
killall -s HUP dnsmasq if [ -x "$(command -v systemctl)" ]; then
systemctl restart dnsmasq
else
service dnsmasq restart
fi
else else
# service not running, start it up # service not running, start it up
if [ -x "$(command -v systemctl)" ]; then
systemctl start dnsmasq
else
service dnsmasq start service dnsmasq start
fi fi
fi
echo " done!" echo " done!"
} }

View File

@ -189,11 +189,19 @@ Reload() {
if [[ ${dnsmasqPid} ]]; then if [[ ${dnsmasqPid} ]]; then
# service already running - reload config # service already running - reload config
killall -s HUP dnsmasq if [ -x "$(command -v systemctl)" ]; then
systemctl restart dnsmasq
else
service dnsmasq restart
fi
else else
# service not running, start it up # service not running, start it up
if [ -x "$(command -v systemctl)" ]; then
systemctl start dnsmasq
else
service dnsmasq start service dnsmasq start
fi fi
fi
echo " done!" echo " done!"
} }

View File

@ -895,12 +895,12 @@ update_dialogs(){
if [[ $? = 0 ]];then if [[ $? = 0 ]];then
case ${UpdateCmd} in case ${UpdateCmd} in
Update) ${opt1a})
echo "::: Updating existing install" echo "::: $opt1a option selected."
useUpdateVars=true useUpdateVars=true
;; ;;
Install) ${opt2a})
echo "::: Running complete install script" echo "::: $opt2a option selected"
useUpdateVars=false useUpdateVars=false
;; ;;
esac esac

View File

@ -310,18 +310,25 @@ gravity_reload() {
adList=${adList//\//\\\/} adList=${adList//\//\\\/}
#Now replace the line in dnsmasq file #Now replace the line in dnsmasq file
sed -i "s/^addn-hosts.*/addn-hosts=$adList/" /etc/dnsmasq.d/01-pihole.conf sed -i "s/^addn-hosts.*/addn-hosts=$adList/" /etc/dnsmasq.d/01-pihole.conf
dnsmasqPid=$(pidof dnsmasq)
find "$piholeDir" -type f -exec chmod 666 {} \; find "$piholeDir" -type f -exec chmod 666 {} \;
dnsmasqPid=$(pidof dnsmasq)
if [[ ${dnsmasqPid} ]]; then if [[ ${dnsmasqPid} ]]; then
# service already running - reload config # service already running - reload config
killall -s HUP dnsmasq if [ -x "$(command -v systemctl)" ]; then
systemctl restart dnsmasq
else
service dnsmasq restart
fi
else else
# service not running, start it up # service not running, start it up
if [ -x "$(command -v systemctl)" ]; then
systemctl start dnsmasq
else
service dnsmasq start service dnsmasq start
fi fi
echo " done!" fi
} }