From 2ec4acfe5285db3fdcdc5961c6a7a7d526b43779 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Thu, 1 Dec 2016 12:21:08 -0800 Subject: [PATCH 1/3] Begin fixing exit values. Signed-off-by: Dan Schaper --- advanced/Scripts/list.sh | 2 +- automated install/basic-install.sh | 10 +++++----- gravity.sh | 2 +- pihole | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh index 24f6d055..5cee8b56 100644 --- a/advanced/Scripts/list.sh +++ b/advanced/Scripts/list.sh @@ -47,7 +47,7 @@ helpFunc() { ::: -h, --help Show this help dialog ::: -l, --list Display your ${word}listed domains EOM - exit 1 + exit 0 } HandleOther(){ diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index d79f05b2..d481c135 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -113,12 +113,12 @@ elif [ $(command -v rpm) ]; then PKG_UPDATE="${PKG_MANAGER} update -y" PKG_INSTALL="${PKG_MANAGER} install -y" PKG_COUNT="${PKG_MANAGER} check-update | egrep '(.i686|.x86|.noarch|.arm|.src)' | wc -l" - INSTALLER_DEPS=( iproute net-tools procps-ng newt git ) - PIHOLE_DEPS=( epel-release bind-utils bc dnsmasq lighttpd lighttpd-fastcgi php-common php-cli php curl unzip wget findutils cronie sudo nmap-ncat ) + INSTALLER_DEPS=(iproute net-tools procps-ng newt git) + PIHOLE_DEPS=(bind-utils bc dnsmasq lighttpd lighttpd-fastcgi php-common php-cli php curl unzip wget findutils cronie sudo nmap-ncat) - if grep -q 'Fedora' /etc/redhat-release; then - remove_deps=(epel-release); - PIHOLE_DEPS=( ${PIHOLE_DEPS[@]/$remove_deps} ); + if ! grep -q 'Fedora' /etc/redhat-release; then + add_deps=(epel-release); + PIHOLE_DEPS=( "${add_deps[@]}" "${PIHOLE_DEPS[@]}" ); fi LIGHTTPD_USER="lighttpd" LIGHTTPD_GROUP="lighttpd" diff --git a/gravity.sh b/gravity.sh index d05dddea..d6b7106b 100755 --- a/gravity.sh +++ b/gravity.sh @@ -23,7 +23,7 @@ helpFunc() { ::: -f, --force Force lists to be downloaded, even if they don't need updating. ::: -h, --help Show this help dialog EOM - exit 1 + exit 0 } diff --git a/pihole b/pihole index 771ab4c3..d8217fed 100755 --- a/pihole +++ b/pihole @@ -227,7 +227,7 @@ helpFunc() { ::: pihole disable 5m - will disable blocking for 5 minutes ::: restartdns Restart dnsmasq EOM - exit 1 + exit 0 } if [[ $# = 0 ]]; then From cb52ad3ba307fc2eb4a303052e3ce72af32eff8b Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Thu, 1 Dec 2016 13:31:35 -0800 Subject: [PATCH 2/3] Revert other branch chages. Signed-off-by: Dan Schaper --- automated install/basic-install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index d481c135..d79f05b2 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -113,12 +113,12 @@ elif [ $(command -v rpm) ]; then PKG_UPDATE="${PKG_MANAGER} update -y" PKG_INSTALL="${PKG_MANAGER} install -y" PKG_COUNT="${PKG_MANAGER} check-update | egrep '(.i686|.x86|.noarch|.arm|.src)' | wc -l" - INSTALLER_DEPS=(iproute net-tools procps-ng newt git) - PIHOLE_DEPS=(bind-utils bc dnsmasq lighttpd lighttpd-fastcgi php-common php-cli php curl unzip wget findutils cronie sudo nmap-ncat) + INSTALLER_DEPS=( iproute net-tools procps-ng newt git ) + PIHOLE_DEPS=( epel-release bind-utils bc dnsmasq lighttpd lighttpd-fastcgi php-common php-cli php curl unzip wget findutils cronie sudo nmap-ncat ) - if ! grep -q 'Fedora' /etc/redhat-release; then - add_deps=(epel-release); - PIHOLE_DEPS=( "${add_deps[@]}" "${PIHOLE_DEPS[@]}" ); + if grep -q 'Fedora' /etc/redhat-release; then + remove_deps=(epel-release); + PIHOLE_DEPS=( ${PIHOLE_DEPS[@]/$remove_deps} ); fi LIGHTTPD_USER="lighttpd" LIGHTTPD_GROUP="lighttpd" From 925c80edd45e962cc824b48693603075e62fa7eb Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Thu, 1 Dec 2016 15:10:06 -0800 Subject: [PATCH 3/3] Catch more 1's Signed-off-by: Dan Schaper --- advanced/Scripts/chronometer.sh | 2 +- advanced/Scripts/version.sh | 2 +- advanced/Scripts/webpage.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/chronometer.sh b/advanced/Scripts/chronometer.sh index 7f2c764a..c4b3d865 100755 --- a/advanced/Scripts/chronometer.sh +++ b/advanced/Scripts/chronometer.sh @@ -121,7 +121,7 @@ displayHelp() { ::: -j, --json output stats as JSON formatted string ::: -h, --help display this help text EOM - exit 1 + exit 0 } if [[ $# = 0 ]]; then diff --git a/advanced/Scripts/version.sh b/advanced/Scripts/version.sh index fc74f8a0..42bd96ce 100644 --- a/advanced/Scripts/version.sh +++ b/advanced/Scripts/version.sh @@ -86,7 +86,7 @@ helpFunc() { ::: -h, --help Show this help dialog ::: EOM - exit 1 + exit 0 } if [[ $# = 0 ]]; then diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index bcb45a14..0a79d853 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -23,7 +23,7 @@ helpFunc() { ::: -f, fahrenheit Set Fahrenheit temperature unit ::: -h, --help Show this help dialog EOM - exit 1 + exit 0 } SetTemperatureUnit(){