Update Installer.sh
Added UFW to the install list Added UFW config Disabled IPv6
This commit is contained in:
parent
36e8302e4b
commit
8da977ab6e
43
Installer.sh
43
Installer.sh
@ -40,8 +40,6 @@ if [[ $dist != debian ]]; then
|
|||||||
clear
|
clear
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ $dist_ver != 11 ]]; then
|
if [[ $dist_ver != 11 ]]; then
|
||||||
if (whiptail --title "Warning" --yesno "This script is tested on Debian 11, use it on your own risk. \nYou're currently running Debian $dist_ver! \n\nContinue anyway?" 10 78); then
|
if (whiptail --title "Warning" --yesno "This script is tested on Debian 11, use it on your own risk. \nYou're currently running Debian $dist_ver! \n\nContinue anyway?" 10 78); then
|
||||||
echo ""
|
echo ""
|
||||||
@ -61,7 +59,6 @@ if (whiptail --title "Pi Automation" --yesno "This installer will turn your Rasp
|
|||||||
else
|
else
|
||||||
INSTALL=no
|
INSTALL=no
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $INSTALL == no ]]; then
|
if [[ $INSTALL == no ]]; then
|
||||||
whiptail --title "Pi Automation" --msgbox "Installation canceled!" 8 78
|
whiptail --title "Pi Automation" --msgbox "Installation canceled!" 8 78
|
||||||
clear
|
clear
|
||||||
@ -100,9 +97,9 @@ OPTIONS=$(whiptail --title "Configure Options" --checklist \
|
|||||||
"Monitor-Service" "Autologin the Pi user and show system and service statuses. (usefull with TFT)" OFF 3>&1 1>&2 2>&3)
|
"Monitor-Service" "Autologin the Pi user and show system and service statuses. (usefull with TFT)" OFF 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
|
|
||||||
##---------------##
|
##-------------------##
|
||||||
# Configuring #
|
# Pre-Configuring #
|
||||||
##---------------##
|
##-------------------##
|
||||||
|
|
||||||
TERM=ansi whiptail --title "Pi Automation" --infobox "Configuring Raspberry Pi" 8 78
|
TERM=ansi whiptail --title "Pi Automation" --infobox "Configuring Raspberry Pi" 8 78
|
||||||
sleep 3
|
sleep 3
|
||||||
@ -137,7 +134,7 @@ if [[ $OPTIONS == *"Monitor-Service"* ]]; then
|
|||||||
wget $GIT/$REPO/$BRANCH/RasPi-Config/monitor.service -O /etc/monitor.service
|
wget $GIT/$REPO/$BRANCH/RasPi-Config/monitor.service -O /etc/monitor.service
|
||||||
echo "" >> /home/pi/.profile
|
echo "" >> /home/pi/.profile
|
||||||
echo "# show Monitor on autologon" >> /home/pi/.profile
|
echo "# show Monitor on autologon" >> /home/pi/.profile
|
||||||
echo "bash /etc/monitor.service" >> /home/pi/.profile
|
echo "sudo bash /etc/monitor.service" >> /home/pi/.profile
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl restart getty@tty1.service
|
systemctl restart getty@tty1.service
|
||||||
fi
|
fi
|
||||||
@ -184,7 +181,7 @@ fi
|
|||||||
$PKGUD
|
$PKGUD
|
||||||
$PKRM manpages* p7zip* vim* pigz* strace* rng-tools* manpages* triggerhappy*
|
$PKRM manpages* p7zip* vim* pigz* strace* rng-tools* manpages* triggerhappy*
|
||||||
apt list --upgradeable 2>/dev/null | cut -d/ -f1 | grep -v Listing >> /tmp/install.list
|
apt list --upgradeable 2>/dev/null | cut -d/ -f1 | grep -v Listing >> /tmp/install.list
|
||||||
echo "unattended-upgrades" /tmp/install.list
|
echo "unattended-upgrades ufw" /tmp/install.list
|
||||||
xargs < /tmp/install.list xargs $PKGI
|
xargs < /tmp/install.list xargs $PKGI
|
||||||
$PKARM
|
$PKARM
|
||||||
|
|
||||||
@ -204,7 +201,6 @@ if [[ $OPTIONS == *"Node-RED"* ]]; then
|
|||||||
cd ~
|
cd ~
|
||||||
wget $GIT/$REPO/$BRANCH/Node-RED/NodeRED.conf -O /root/.node-red/settings.js
|
wget $GIT/$REPO/$BRANCH/Node-RED/NodeRED.conf -O /root/.node-red/settings.js
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $OPTIONS == *"Zigbee2MQTT"* ]]; then
|
if [[ $OPTIONS == *"Zigbee2MQTT"* ]]; then
|
||||||
mkdir -p /opt/zigbee2mqtt/
|
mkdir -p /opt/zigbee2mqtt/
|
||||||
git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt
|
git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt
|
||||||
@ -218,13 +214,11 @@ if [[ $OPTIONS == *"Zigbee2MQTT"* ]]; then
|
|||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable zigbee2mqtt
|
systemctl enable zigbee2mqtt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $OPTIONS == *"Unattended-Upgrades"* ]]; then
|
if [[ $OPTIONS == *"Unattended-Upgrades"* ]]; then
|
||||||
systemctl stop unattended-upgrades
|
systemctl stop unattended-upgrades
|
||||||
wget $GIT/$REPO/$BRANCH/Unattended-Security-Updates/20auto-upgrades -O /etc/apt/apt.conf.d/20auto-upgrades
|
wget $GIT/$REPO/$BRANCH/Unattended-Security-Updates/20auto-upgrades -O /etc/apt/apt.conf.d/20auto-upgrades
|
||||||
wget $GIT/$REPO/$BRANCH/Unattended-Security-Updates/50debian-unattended-upgrades -O /etc/apt/apt.conf.d/50unattended-upgrades
|
wget $GIT/$REPO/$BRANCH/Unattended-Security-Updates/50debian-unattended-upgrades -O /etc/apt/apt.conf.d/50unattended-upgrades
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $OPTIONS == *"Domoticz"* ]]; then
|
if [[ $OPTIONS == *"Domoticz"* ]]; then
|
||||||
mkdir -p /etc/domoticz/
|
mkdir -p /etc/domoticz/
|
||||||
wget $GIT/$REPO/$BRANCH/Domoticz/DomoSetup.conf -O /etc/domoticz/setupVars.conf
|
wget $GIT/$REPO/$BRANCH/Domoticz/DomoSetup.conf -O /etc/domoticz/setupVars.conf
|
||||||
@ -239,6 +233,31 @@ if [[ $OPTIONS == *"Domoticz"* ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
##---------------##
|
||||||
|
# Configuring #
|
||||||
|
##---------------##
|
||||||
|
|
||||||
|
echo "" >> /etc/sysctl.conf
|
||||||
|
echo "#Disable IPv6" >> /etc/sysctl.conf
|
||||||
|
echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
|
||||||
|
echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf
|
||||||
|
echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf
|
||||||
|
|
||||||
|
sed -i 's/IPV6=yes/IPV6=no/g' /etc/default/ufw
|
||||||
|
|
||||||
|
ufw default deny incoming
|
||||||
|
ufw default allow outgoing
|
||||||
|
|
||||||
|
ufw allow 1880/tcp
|
||||||
|
ufw allow 1880/udp
|
||||||
|
ufw allow 1883/tcp
|
||||||
|
ufw allow 1883/udp
|
||||||
|
ufw allow 8080/tcp
|
||||||
|
ufw limit 22/tcp
|
||||||
|
|
||||||
|
echo "y" | ufw enable
|
||||||
|
|
||||||
|
|
||||||
##-----------------##
|
##-----------------##
|
||||||
# Optimizing Pi #
|
# Optimizing Pi #
|
||||||
##-----------------##
|
##-----------------##
|
||||||
@ -274,6 +293,7 @@ echo $OPTIONS > /etc/installedmodules
|
|||||||
sed -i 's/\s\+/\n/g' /etc/installedmodules
|
sed -i 's/\s\+/\n/g' /etc/installedmodules
|
||||||
sed -i 's/\"//g' /etc/installedmodules
|
sed -i 's/\"//g' /etc/installedmodules
|
||||||
|
|
||||||
|
|
||||||
##-------------##
|
##-------------##
|
||||||
# Finishing #
|
# Finishing #
|
||||||
##-------------##
|
##-------------##
|
||||||
@ -282,7 +302,6 @@ wget $GIT/$REPO/$BRANCH/Updater.sh -O /opt/updater.sh
|
|||||||
wget $GIT/$REPO/$BRANCH/MOTD/greetings.sh -O /etc/profile.d/greeting.sh
|
wget $GIT/$REPO/$BRANCH/MOTD/greetings.sh -O /etc/profile.d/greeting.sh
|
||||||
sed -i -e "s/%name%/$NAME/g" /etc/profile.d/greeting.sh
|
sed -i -e "s/%name%/$NAME/g" /etc/profile.d/greeting.sh
|
||||||
|
|
||||||
|
|
||||||
mkdir -p /opt/backups/timestamps/
|
mkdir -p /opt/backups/timestamps/
|
||||||
echo "Installed on: $DATE" > /opt/backups/timestamps/OS.update
|
echo "Installed on: $DATE" > /opt/backups/timestamps/OS.update
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user