From 0a8761ee68c4d6b79201d52793dd4d1aefe60e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Wed, 6 Jul 2022 22:51:39 +0200 Subject: [PATCH 1/2] Rename PH_TEST to SKIP_INSTALL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Scripts/webpage.sh | 4 ++-- automated install/basic-install.sh | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index 279de9e9..29c53bd6 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -24,8 +24,8 @@ readonly gravityDBfile="/etc/pihole/gravity.db" # Source install script for ${setupVars}, ${PI_HOLE_BIN_DIR} and valid_ip() readonly PI_HOLE_FILES_DIR="/etc/.pihole" -# shellcheck disable=SC2034 # used in basic-install -PH_TEST="true" +# shellcheck disable=SC2034 # used in basic-install to source the script without running it +SKIP_INSTALL="true" source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh" utilsfile="/opt/pihole/utils.sh" diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 9680e9f9..91f7f392 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2860,6 +2860,8 @@ main() { fi } -if [[ "${PH_TEST}" != true ]] ; then +# allow to source this script without running it +# used in docker-pihole and webpage.sh +if [[ "${SKIP_INSTALL}" != true ]] ; then main "$@" fi From 518cbd10e0858c642be97b67af67b1598991e38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Wed, 6 Jul 2022 22:58:14 +0200 Subject: [PATCH 2/2] Rename also in docker files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Scripts/piholeCheckout.sh | 2 +- advanced/Scripts/update.sh | 2 +- automated install/basic-install.sh | 1 - automated install/uninstall.sh | 2 +- test/_centos_7.Dockerfile | 2 +- test/_centos_8.Dockerfile | 2 +- test/_debian_10.Dockerfile | 2 +- test/_debian_11.Dockerfile | 2 +- test/_fedora_34.Dockerfile | 2 +- test/_ubuntu_18.Dockerfile | 2 +- test/_ubuntu_20.Dockerfile | 2 +- test/_ubuntu_21.Dockerfile | 2 +- test/_ubuntu_22.Dockerfile | 2 +- 13 files changed, 12 insertions(+), 13 deletions(-) diff --git a/advanced/Scripts/piholeCheckout.sh b/advanced/Scripts/piholeCheckout.sh index 4c0a4f40..7c4a1f77 100755 --- a/advanced/Scripts/piholeCheckout.sh +++ b/advanced/Scripts/piholeCheckout.sh @@ -9,7 +9,7 @@ # Please see LICENSE file for your rights under this license. readonly PI_HOLE_FILES_DIR="/etc/.pihole" -PH_TEST="true" +SKIP_INSTALL="true" source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh" # webInterfaceGitUrl set in basic-install.sh diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index 9da85c89..609a054b 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -17,7 +17,7 @@ readonly PI_HOLE_GIT_URL="https://github.com/pi-hole/pi-hole.git" readonly PI_HOLE_FILES_DIR="/etc/.pihole" # shellcheck disable=SC2034 -PH_TEST=true +SKIP_INSTALL=true # when --check-only is passed to this script, it will not perform the actual update CHECK_ONLY=false diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 91f7f392..047be76e 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2861,7 +2861,6 @@ main() { } # allow to source this script without running it -# used in docker-pihole and webpage.sh if [[ "${SKIP_INSTALL}" != true ]] ; then main "$@" fi diff --git a/automated install/uninstall.sh b/automated install/uninstall.sh index a0bb2e5b..a58ad753 100755 --- a/automated install/uninstall.sh +++ b/automated install/uninstall.sh @@ -36,7 +36,7 @@ else fi readonly PI_HOLE_FILES_DIR="/etc/.pihole" -PH_TEST="true" +SKIP_INSTALL="true" source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh" # setupVars set in basic-install.sh source "${setupVars}" diff --git a/test/_centos_7.Dockerfile b/test/_centos_7.Dockerfile index ccffc00d..b97f1679 100644 --- a/test/_centos_7.Dockerfile +++ b/test/_centos_7.Dockerfile @@ -13,7 +13,7 @@ ADD test/centos7.epel.override /etc/yum/pluginconf.d/fastestmirror.conf RUN true && \ chmod +x $SCRIPTDIR/* -ENV PH_TEST true +ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net #sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ diff --git a/test/_centos_8.Dockerfile b/test/_centos_8.Dockerfile index 86e5a778..2a894587 100644 --- a/test/_centos_8.Dockerfile +++ b/test/_centos_8.Dockerfile @@ -12,7 +12,7 @@ ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR RUN true && \ chmod +x $SCRIPTDIR/* -ENV PH_TEST true +ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net #sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ diff --git a/test/_debian_10.Dockerfile b/test/_debian_10.Dockerfile index 54800d3c..3b177cc8 100644 --- a/test/_debian_10.Dockerfile +++ b/test/_debian_10.Dockerfile @@ -11,7 +11,7 @@ ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR RUN true && \ chmod +x $SCRIPTDIR/* -ENV PH_TEST true +ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net #sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ diff --git a/test/_debian_11.Dockerfile b/test/_debian_11.Dockerfile index 39be027e..58c67e0f 100644 --- a/test/_debian_11.Dockerfile +++ b/test/_debian_11.Dockerfile @@ -11,7 +11,7 @@ ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR RUN true && \ chmod +x $SCRIPTDIR/* -ENV PH_TEST true +ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net #sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ diff --git a/test/_fedora_34.Dockerfile b/test/_fedora_34.Dockerfile index fbbaacd6..9c90ce7d 100644 --- a/test/_fedora_34.Dockerfile +++ b/test/_fedora_34.Dockerfile @@ -12,7 +12,7 @@ ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR RUN true && \ chmod +x $SCRIPTDIR/* -ENV PH_TEST true +ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net #sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ diff --git a/test/_ubuntu_18.Dockerfile b/test/_ubuntu_18.Dockerfile index 592c5c3f..47f1893e 100644 --- a/test/_ubuntu_18.Dockerfile +++ b/test/_ubuntu_18.Dockerfile @@ -11,7 +11,7 @@ ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR RUN true && \ chmod +x $SCRIPTDIR/* -ENV PH_TEST true +ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net #sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ diff --git a/test/_ubuntu_20.Dockerfile b/test/_ubuntu_20.Dockerfile index 80e2e007..c63f883a 100644 --- a/test/_ubuntu_20.Dockerfile +++ b/test/_ubuntu_20.Dockerfile @@ -12,7 +12,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN true && \ chmod +x $SCRIPTDIR/* -ENV PH_TEST true +ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net #sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ diff --git a/test/_ubuntu_21.Dockerfile b/test/_ubuntu_21.Dockerfile index 6d4d7fbc..05801de8 100644 --- a/test/_ubuntu_21.Dockerfile +++ b/test/_ubuntu_21.Dockerfile @@ -12,7 +12,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN true && \ chmod +x $SCRIPTDIR/* -ENV PH_TEST true +ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net #sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ diff --git a/test/_ubuntu_22.Dockerfile b/test/_ubuntu_22.Dockerfile index f9876d50..d44518b4 100644 --- a/test/_ubuntu_22.Dockerfile +++ b/test/_ubuntu_22.Dockerfile @@ -12,7 +12,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN true && \ chmod +x $SCRIPTDIR/* -ENV PH_TEST true +ENV SKIP_INSTALL true ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net #sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \