From 23e42f5f0f641f175b5ddb3137c725d827f16b9c Mon Sep 17 00:00:00 2001 From: "b.waal" Date: Wed, 6 Sep 2023 02:23:53 +0200 Subject: [PATCH] Update 'Installer.sh' --- Installer.sh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/Installer.sh b/Installer.sh index 5dde7cc..e8e2dde 100644 --- a/Installer.sh +++ b/Installer.sh @@ -11,8 +11,9 @@ PKGUD="$PKGM update" PKGUP="$PKGM upgrade -y" PKGI="${PKGM} install -y" ###DEBIAN### - -alias pihole="/usr/local/bin/pihole" +###ALPINE### +VER=3.17 +###ALPINE### REPO=Pi-Hole BRANCH=main GIT=https://git.ictcorpnet.com/b.waal/$REPO/raw @@ -34,8 +35,8 @@ source /tmp/OScheck.sh if [[ $dist == "Alpine" ]]; then if (whiptail --title "Setup" --yesno "Use an APT-Cacher?" 8 78); then CACHE=$(whiptail --inputbox "What is the IP address for APT-Cacher?" 8 78 192.168.1.102 --title "Setup" 3>&1 1>&2 2>&3) - echo "http://XXX.XXX.XXX.XXX/alpine/v3.18/main" > /etc/apk/repositories - echo "http://XXX.XXX.XXX.XXX/alpine/v3.18/community" >> /etc/apk/repositories + echo "http://XXX.XXX.XXX.XXX/alpine/v$VER/main" > /etc/apk/repositories + echo "http://XXX.XXX.XXX.XXX/alpine/v$VER/community" >> /etc/apk/repositories echo "http://XXX.XXX.XXX.XXX/alpine/edge/testing/" >> /etc/apk/repositories sed -i "s/XXX.XXX.XXX.XXX/$CACHE/g" /etc/apk/repositories else @@ -47,8 +48,8 @@ if [[ $dist == "Debian" ]]; then CACHE=$(whiptail --inputbox "What is the IP address for APT-Cacher?" 8 78 192.168.1.102 --title "Setup" 3>&1 1>&2 2>&3) echo 'Acquire::http::Proxy "http://XXX.XXX.XXX.XXX:80";'> /etc/apt/apt.conf.d/01prox sed -i "s/XXX.XXX.XXX.XXX/$CACHE/g" /etc/apt/apt.conf.d/01prox - echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf.d/01Recommends - echo 'APT::Install-Suggests "false";' >> /etc/apt/apt.conf.d/01Suggests + echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/01Recommends + echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/01Suggests else echo "" fi @@ -138,14 +139,17 @@ bash /tmp/pi-hole/automated\ install/basic-install.sh --unattended fi if [[ $dist == "Debian" ]]; then - echo "git iproute2 dialog ca-certificates cron curl iputils-ping psmisc sudo unzip idn2 libcap2-bin dns-root-data libcap2 netcat-openbsd procps jq" /tmp/install.list + echo "git iproute2 dialog ca-certificates cron curl iputils-ping psmisc sudo unzip idn2 libcap2-bin dns-root-data libcap2 netcat-openbsd procps jq" >> /tmp/install.list + if [[ $UNBOUND == "true" ]]; then + echo "unbound" >> /tmp/install.list + fi if [[ $UFW == "true" ]]; then - echo "ufw" >> /tmp/install.list + echo "ufw" >> /tmp/install.list fi if [[ $UNATTENDED == "true" ]]; then - echo "unattended-upgrades apt-listchanges" >> /tmp/install.list + echo "unattended-upgrades apt-listchanges" >> /tmp/install.list fi - xargs < /tmp/install.list xargs apt install -y + xargs < /tmp/install.list xargs $PKGI git clone --depth 1 https://github.com/pi-hole/pi-hole.git /tmp/pi-hole bash /tmp/pi-hole/automated\ install/basic-install.sh --unattended fi @@ -155,6 +159,8 @@ fi # Configuring # ##---------------## +ln -s /usr/local/bin/pihole /usr/bin/pihole + if [[ $UNBOUND == "true" ]]; then if [[ $dist == "Alpine" ]]; then service unbound stop && service pihole-FTL stop @@ -204,6 +210,5 @@ fi # Finishing # ##-------------## -ln -s /usr/local/bin/pihole /usr/bin/pihole whiptail --title "Done!" --msgbox "Pihole is now available on http://LXC.IP.ADDRESS.HERE/admin\n\nPress OK to continue." 10 78 exit \ No newline at end of file