Merge branch 'development' into developmentNew

This commit is contained in:
Adam Warner 2017-07-16 16:45:33 +01:00
commit eb8333c772
No known key found for this signature in database
GPG key ID: 03843F6C65554B22
3 changed files with 255 additions and 65 deletions

View file

@ -221,18 +221,19 @@ Reboot() {
}
RestartDNS() {
local str="Restarting dnsmasq"
echo -ne " ${INFO} ${str}..."
if [[ -x "$(command -v systemctl)" ]]; then
systemctl restart dnsmasq
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
service dnsmasq restart
output=$( { service dnsmasq restart; } 2>&1 )
fi
if [[ "$?" == 0 ]]; then
echo -e "${OVER} ${TICK} ${str}"
if [[ -z "${output}" ]]; then
[[ -t 1 ]] && echo -e "${OVER} ${TICK} ${str}"
else
echo -e "${OVER} ${CROSS} ${str}"
[[ ! -t 1 ]] && OVER=""
echo -e "${OVER} ${CROSS} ${output}"
fi
}