mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-24 13:50:17 +00:00
Remove duplicate code
* Make RestartDNS() use `pihole restartdns` Signed-off-by: WaLLy3K <wally3k@pi-hole.net>
This commit is contained in:
parent
406098e55a
commit
61ff0452e1
1 changed files with 1 additions and 14 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue