From c6857501aa854502b06dd89f065459238aecaff4 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 17 Nov 2016 23:31:11 +0100 Subject: [PATCH] Removed check for availability of nohup --- pihole | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/pihole b/pihole index fca1ed63..02a64827 100755 --- a/pihole +++ b/pihole @@ -118,25 +118,20 @@ piholeEnable() { sed -i 's/^addn-hosts/#addn-hosts/' /etc/dnsmasq.d/01-pihole.conf echo "::: Blocking has been disabled!" if [[ $# > 1 ]] ; then - if [ -x "$(command -v nohup)" ]; then - if [[ ${2} == *"s"* ]] ; then - tt=${2%"s"} - echo "::: Blocking will be reenabled in ${tt} seconds" - nohup bash -c "sleep ${tt}; pihole enable" /dev/null & - elif [[ ${2} == *"m"* ]] ; then - tt=${2%"m"} - echo "::: Blocking will be reenabled in ${tt} minutes" - tt=$((${tt}*60)) - nohup bash -c "sleep ${tt}; pihole enable" /dev/null & - else - echo "::: Unknown format for delayed reactivation of the blocking!" - echo "::: Example:" - echo "::: pihole disable 5s - will disable blocking for 5 seconds" - echo "::: pihole disable 7m - will disable blocking for 7 minutes" - echo "::: Blocking will not automatically be reenabled!" - fi + if [[ ${2} == *"s"* ]] ; then + tt=${2%"s"} + echo "::: Blocking will be reenabled in ${tt} seconds" + nohup bash -c "sleep ${tt}; pihole enable" /dev/null & + elif [[ ${2} == *"m"* ]] ; then + tt=${2%"m"} + echo "::: Blocking will be reenabled in ${tt} minutes" + tt=$((${tt}*60)) + nohup bash -c "sleep ${tt}; pihole enable" /dev/null & else - echo "::: Command 'nohup' has to be available for this feature." + echo "::: Unknown format for delayed reactivation of the blocking!" + echo "::: Example:" + echo "::: pihole disable 5s - will disable blocking for 5 seconds" + echo "::: pihole disable 7m - will disable blocking for 7 minutes" echo "::: Blocking will not automatically be reenabled!" fi fi @@ -247,7 +242,7 @@ case "${1}" in "-q" | "query" ) queryFunc "$@";; "-l" | "logging" ) piholeLogging "$@";; "uninstall" ) uninstallFunc;; - "enable" ) piholeEnable 1 $2;; + "enable" ) piholeEnable 1;; "disable" ) piholeEnable 0 $2;; "status" ) piholeStatus "$2";; "restartdns" ) restartDNS;;