Update 'Installer.sh'
Changed Alpine version to 3.18 Renamed Check OS to Pre-Check, now including dialog for static IP. Added Log2Ram for Debian installs. Added IP var to display when setup is finished. Changed repo for Unattended-Upgrades.
This commit is contained in:
parent
46924deb99
commit
7d8329c344
69
Installer.sh
69
Installer.sh
@ -12,21 +12,28 @@ PKGUP="$PKGM upgrade -y"
|
|||||||
PKGI="${PKGM} install -y"
|
PKGI="${PKGM} install -y"
|
||||||
###DEBIAN###
|
###DEBIAN###
|
||||||
###ALPINE###
|
###ALPINE###
|
||||||
VER=3.17
|
VER=3.18
|
||||||
###ALPINE###
|
###ALPINE###
|
||||||
REPO=Pi-Hole
|
REPO=Pi-Hole
|
||||||
BRANCH=main
|
BRANCH=main
|
||||||
GIT=https://git.ictcorpnet.com/b.waal/$REPO/raw
|
GIT=https://git.ictcorpnet.com/b.waal/$REPO/raw
|
||||||
|
|
||||||
|
|
||||||
|
##------------##
|
||||||
##-----------##
|
# Pre-Check #
|
||||||
# Check OS #
|
##------------##
|
||||||
##-----------##
|
|
||||||
|
|
||||||
wget $GIT/$BRANCH/Config/OScheck.sh -O /tmp/OScheck.sh
|
wget $GIT/$BRANCH/Config/OScheck.sh -O /tmp/OScheck.sh
|
||||||
source /tmp/OScheck.sh
|
source /tmp/OScheck.sh
|
||||||
|
|
||||||
|
if (whiptail --title "Pi Automation" --yesno "Is this device configured with a static IP?." 8 78); then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
whiptail --title "Pi Automation" --msgbox "Configure a static IP first!" 8 78
|
||||||
|
clear
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
##----------##
|
##----------##
|
||||||
# Menu #
|
# Menu #
|
||||||
@ -65,18 +72,25 @@ if (whiptail --title "Setup" --yesno "Install UFW?" 8 78); then
|
|||||||
else
|
else
|
||||||
UFW=false
|
UFW=false
|
||||||
fi
|
fi
|
||||||
if [[ $dist == "Debian" ]]; then
|
|
||||||
if (whiptail --title "Setup" --yesno "Unattended-Upgrades" 8 78); then
|
|
||||||
UNATTENDED=true
|
|
||||||
else
|
|
||||||
UNATTENDED=false
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if (whiptail --title "Setup" --yesno "Disable IPv6?" 8 78); then
|
if (whiptail --title "Setup" --yesno "Disable IPv6?" 8 78); then
|
||||||
IPv6=false
|
IPv6=false
|
||||||
else
|
else
|
||||||
IPv6=true
|
IPv6=true
|
||||||
fi
|
fi
|
||||||
|
if [[ $dist == "Debian" ]]; then
|
||||||
|
if (whiptail --title "Setup" --yesno "Install Log2Ram" 8 78); then
|
||||||
|
L2R=true
|
||||||
|
else
|
||||||
|
L2R=false
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [[ $dist == "Debian" ]]; then
|
||||||
|
if (whiptail --title "Setup" --yesno "Install Unattended-Upgrades?" 8 78); then
|
||||||
|
UNATTENDED=true
|
||||||
|
else
|
||||||
|
UNATTENDED=false
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
##-----------##
|
##-----------##
|
||||||
@ -98,6 +112,14 @@ fi
|
|||||||
# Pre-Config #
|
# Pre-Config #
|
||||||
##--------------##
|
##--------------##
|
||||||
|
|
||||||
|
if [[ $dist == "Alpine" ]]; then
|
||||||
|
IP=`hostname -i` && IP=$(echo $IP | cut -d' ' -f2,3)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $dist == "Debian" ]]; then
|
||||||
|
IP=`hostname -I` && IP=$(echo $IP | cut -d' ' -f2,3)
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p /etc/pihole
|
mkdir -p /etc/pihole
|
||||||
wget $GIT/$BRANCH/Config/Pihole/pihole-FTL.conf -O /etc/pihole/pihole-FTL.conf
|
wget $GIT/$BRANCH/Config/Pihole/pihole-FTL.conf -O /etc/pihole/pihole-FTL.conf
|
||||||
wget $GIT/$BRANCH/Config/Pihole/setupVars.conf -O /etc/pihole/setupVars.conf
|
wget $GIT/$BRANCH/Config/Pihole/setupVars.conf -O /etc/pihole/setupVars.conf
|
||||||
@ -146,6 +168,9 @@ if [[ $dist == "Debian" ]]; then
|
|||||||
if [[ $UFW == "true" ]]; then
|
if [[ $UFW == "true" ]]; then
|
||||||
echo "ufw" >> /tmp/install.list
|
echo "ufw" >> /tmp/install.list
|
||||||
fi
|
fi
|
||||||
|
if [[ $L2R == "true" ]]; then
|
||||||
|
echo "rsync tar" >> /tmp/install.list
|
||||||
|
fi
|
||||||
if [[ $UNATTENDED == "true" ]]; then
|
if [[ $UNATTENDED == "true" ]]; then
|
||||||
echo "unattended-upgrades apt-listchanges" >> /tmp/install.list
|
echo "unattended-upgrades apt-listchanges" >> /tmp/install.list
|
||||||
fi
|
fi
|
||||||
@ -201,8 +226,22 @@ if [[ $UFW == "true" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $UNATTENDED == "true" ]]; then
|
if [[ $UNATTENDED == "true" ]]; then
|
||||||
wget https://git.ictcorpnet.com/b.waal/PiAutomation/raw/branch/main/Unattended-Security-Updates/20auto-upgrades -O /etc/apt/apt.conf.d/20auto-upgrades
|
wget https://git.ictcorpnet.com/b.waal/Unattended-Upgrades/raw/branch/main/20auto-upgrades -O /etc/apt/apt.conf.d/20auto-upgrades
|
||||||
wget https://git.ictcorpnet.com/b.waal/PiAutomation/raw/branch/main/Unattended-Security-Updates/50debian-unattended-upgrades -O /etc/apt/apt.conf.d/50unattended-upgrades
|
wget https://git.ictcorpnet.com/b.waal/Unattended-Upgrades/raw/branch/main/50debian-unattended-upgrades -O /etc/apt/apt.conf.d/50unattended-upgrades
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $L2R == "true" ]]; then
|
||||||
|
curl -L https://github.com/azlux/log2ram/archive/master.tar.gz -o /tmp/log2ram.tar.gz
|
||||||
|
tar zxfv /tmp/log2ram.tar.gz -C /tmp/
|
||||||
|
cd /tmp/log2ram-master/
|
||||||
|
chmod +x install.sh && sudo ./install.sh
|
||||||
|
systemctl daemon-reload
|
||||||
|
cd ~
|
||||||
|
|
||||||
|
sed -i -e 's/MAIL=true/MAIL=false/g' /etc/log2ram.conf
|
||||||
|
journalctl --vacuum-size=32M
|
||||||
|
systemctl restart systemd-journald
|
||||||
|
rm -rf /var/log/journal
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -210,5 +249,5 @@ fi
|
|||||||
# Finishing #
|
# Finishing #
|
||||||
##-------------##
|
##-------------##
|
||||||
|
|
||||||
whiptail --title "Done!" --msgbox "Pihole is now available on http://LXC.IP.ADDRESS.HERE/admin\n\nPress OK to continue." 10 78
|
whiptail --title "Done!" --msgbox "Pi-Hole is now available on http://$IP/admin\n\nPress OK to continue." 10 78
|
||||||
exit
|
exit
|
||||||
Loading…
x
Reference in New Issue
Block a user