Remove duplicate code

* Make RestartDNS() use `pihole restartdns`

Signed-off-by: WaLLy3K <wally3k@pi-hole.net>
This commit is contained in:
WaLLy3K 2017-07-24 21:27:12 +10:00 committed by GitHub
parent 406098e55a
commit 61ff0452e1

View file

@ -221,20 +221,7 @@ Reboot() {
}
RestartDNS() {
local str="Restarting DNS service"
[[ -t 1 ]] && echo -ne " ${INFO} ${str}"
if command -v systemctl &> /dev/null; then
output=$( { systemctl restart dnsmasq; } 2>&1 )
else
output=$( { service dnsmasq restart; } 2>&1 )
fi
if [[ -z "${output}" ]]; then
[[ -t 1 ]] && echo -e "${OVER} ${TICK} ${str}"
else
[[ ! -t 1 ]] && OVER=""
echo -e "${OVER} ${CROSS} ${output}"
fi
/usr/local/bin/pihole restartdns
}
SetQueryLogOptions() {