Update 'Installer.sh'

Updated repo url's to reflect new Git server
This commit is contained in:
b.waal 2023-08-25 05:09:29 +02:00
parent 26d566d6e6
commit 14cfd5e2bd

View File

@ -33,8 +33,8 @@ PKARM="$PKGM autoremove -y"
DATE=$(date "+%d-%m-%Y") DATE=$(date "+%d-%m-%Y")
CORES=`nproc --all` CORES=`nproc --all`
REPO=PiAutomation REPO=PiAutomation
GIT=https://raw.githubusercontent.com/Beeranco
BRANCH=main BRANCH=main
GIT=https://git.ictcorpnet.com/b.waal/$REPO/raw
##---------------## ##---------------##
@ -48,7 +48,7 @@ $PKGI curl wget whiptail
# Check if Pi is compatible # # Check if Pi is compatible #
##----------------------------## ##----------------------------##
wget $GIT/$REPO/$BRANCH/RasPi-Config/Requirements.sh -O /tmp/Requirements.sh wget $GIT/$BRANCH/RasPi-Config/Requirements.sh -O /tmp/Requirements.sh
source /tmp/Requirements.sh source /tmp/Requirements.sh
##-----------## ##-----------##
@ -178,8 +178,8 @@ 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-Suggests "false";' >> /etc/apt/apt.conf.d/01Suggests
if [[ $OPTIONS == *"Monitor-Service"* ]]; then if [[ $OPTIONS == *"Monitor-Service"* ]]; then
wget $GIT/$REPO/$BRANCH/RasPi-Config/autologin -O /etc/systemd/system/getty@tty1.service.d/autologin.conf wget $GIT/$BRANCH/RasPi-Config/autologin -O /etc/systemd/system/getty@tty1.service.d/autologin.conf
wget $GIT/$REPO/$BRANCH/RasPi-Config/monitor.service -O /etc/monitor.service wget $GIT/$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 "sudo bash /etc/monitor.service 2>/dev/null" >> /home/pi/.profile echo "sudo bash /etc/monitor.service 2>/dev/null" >> /home/pi/.profile
@ -268,21 +268,21 @@ if [[ $OPTIONS == *"Node-RED"* ]]; then
cd /root/.node-red/ cd /root/.node-red/
npm install @node-red-contrib-themes/midnight-red npm install @node-red-contrib-themes/midnight-red
cd ~ cd ~
wget $GIT/$REPO/$BRANCH/Node-RED/NodeRED.conf -O /root/.node-red/settings.js wget $GIT/$BRANCH/Node-RED/NodeRED.conf -O /root/.node-red/settings.js
fi fi
if [[ $OPTIONS == *"Zigbee2MQTT"* ]]; then if [[ $OPTIONS == *"Zigbee2MQTT"* ]]; then
TERM=ansi whiptail --title "Pi Automation" --infobox "Installing Zigbee2MQTT." 8 78 TERM=ansi whiptail --title "Pi Automation" --infobox "Installing Zigbee2MQTT." 8 78
sleep 3 sleep 3
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
wget $GIT/$REPO/$BRANCH/Zigbee/zb2mqtt.config -O /opt/zigbee2mqtt/data/configuration.yaml wget $GIT/$BRANCH/Zigbee/zb2mqtt.config -O /opt/zigbee2mqtt/data/configuration.yaml
cd /opt/zigbee2mqtt/ cd /opt/zigbee2mqtt/
npm ci /opt/zigbee2mqtt/ npm ci /opt/zigbee2mqtt/
npm install -g npm@latest npm install -g npm@latest
npm audit fix npm audit fix
npm start /opt/zigbee2mqtt/ npm start /opt/zigbee2mqtt/
cd ~ cd ~
wget $GIT/$REPO/$BRANCH/Zigbee/z2mqtt.service -O /etc/systemd/system/zigbee2mqtt.service wget $GIT/$BRANCH/Zigbee/z2mqtt.service -O /etc/systemd/system/zigbee2mqtt.service
systemctl daemon-reload systemctl daemon-reload
systemctl enable zigbee2mqtt systemctl enable zigbee2mqtt
fi fi
@ -290,8 +290,8 @@ if [[ $OPTIONS == *"Homer"* ]]; then
TERM=ansi whiptail --title "Pi Automation" --infobox "Installing Homer." 8 78 TERM=ansi whiptail --title "Pi Automation" --infobox "Installing Homer." 8 78
sleep 3 sleep 3
rm /etc/nginx/sites/enabled/default rm /etc/nginx/sites/enabled/default
wget $GIT/$REPO/$BRANCH/Homer/site.conf -O /etc/nginx/sites-enabled/dashboard wget $GIT/$BRANCH/Homer/site.conf -O /etc/nginx/sites-enabled/dashboard
wget $GIT/$REPO/$BRANCH/Homer/dashboard.zip -O /tmp/dashboard.zip wget $GIT/$BRANCH/Homer/dashboard.zip -O /tmp/dashboard.zip
mkdir -p /var/www/html mkdir -p /var/www/html
mkdir -p /var/log/nginx/ mkdir -p /var/log/nginx/
systemctl enable --now nginx systemctl enable --now nginx
@ -302,10 +302,10 @@ fi
if [[ $OPTIONS == *"Domoticz"* ]]; then if [[ $OPTIONS == *"Domoticz"* ]]; then
TERM=ansi whiptail --title "Pi Automation" --msgbox "In the next dialog tell Domoticz to update.\nDo NOT select reconfigure!\n\nPress OK to continue." 10 78 TERM=ansi whiptail --title "Pi Automation" --msgbox "In the next dialog tell Domoticz to update.\nDo NOT select reconfigure!\n\nPress OK to continue." 10 78
mkdir -p /etc/domoticz/ mkdir -p /etc/domoticz/
wget $GIT/$REPO/$BRANCH/Domoticz/DomoSetup.conf -O /etc/domoticz/setupVars.conf wget $GIT/$BRANCH/Domoticz/DomoSetup.conf -O /etc/domoticz/setupVars.conf
mkdir -p /opt/domoticz/ mkdir -p /opt/domoticz/
bash -c "$(curl -sSfL https://install.domoticz.com)" bash -c "$(curl -sSfL https://install.domoticz.com)"
wget $GIT/$REPO/$BRANCH/Domoticz/DomoService.conf -O /etc/init.d/domoticz.sh wget $GIT/$BRANCH/Domoticz/DomoService.conf -O /etc/init.d/domoticz.sh
chmod +x /etc/init.d/domoticz.sh chmod +x /etc/init.d/domoticz.sh
update-rc.d domoticz.sh defaults update-rc.d domoticz.sh defaults
systemctl start domoticz systemctl start domoticz
@ -337,15 +337,17 @@ ufw default allow outgoing
if [[ $OPTIONS == *"Domoticz"* ]]; then if [[ $OPTIONS == *"Domoticz"* ]]; then
ufw allow 8080/tcp ufw allow 8080/tcp
fi fi
if [[ $OPTIONS == *"Zigbee2MQTT"* ]]; then if [[ $OPTIONS == *"Node-RED"* ]] || [[ $OPTIONS == *"Zigbee2MQTT"* ]]; then
ufw allow 5002/tcp
ufw allow 1883/tcp ufw allow 1883/tcp
ufw allow 1883/udp ufw allow 1883/udp
if [[ $OPTIONS == *"Zigbee2MQTT"* ]]; then
ufw allow 5002/tcp
fi fi
if [[ $OPTIONS == *"Node-RED"* ]]; then if [[ $OPTIONS == *"Node-RED"* ]]; then
ufw allow 1880/tcp ufw allow 1880/tcp
ufw allow 1880/udp ufw allow 1880/udp
fi fi
fi
if [[ $OPTIONS == *"Homer"* ]]; then if [[ $OPTIONS == *"Homer"* ]]; then
ufw allow 80/tcp ufw allow 80/tcp
fi fi
@ -357,8 +359,8 @@ if [[ $OPTIONS == *"Unattended-Upgrades"* ]]; then
TERM=ansi whiptail --title "Pi Automation" --infobox "Configuring Unattended-Upgrades." 8 78 TERM=ansi whiptail --title "Pi Automation" --infobox "Configuring Unattended-Upgrades." 8 78
sleep 3 sleep 3
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/$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/$BRANCH/Unattended-Security-Updates/50debian-unattended-upgrades -O /etc/apt/apt.conf.d/50unattended-upgrades
fi fi
TERM=ansi whiptail --title "Pi Automation" --infobox "Configuring Homer." 8 78 TERM=ansi whiptail --title "Pi Automation" --infobox "Configuring Homer." 8 78
@ -489,8 +491,8 @@ $PKARM
TERM=ansi whiptail --title "Pi Automation" --infobox "Finishing." 8 78 TERM=ansi whiptail --title "Pi Automation" --infobox "Finishing." 8 78
sleep 3 sleep 3
wget $GIT/$REPO/$BRANCH/Updater.sh -O /opt/updater.sh wget $GIT/$BRANCH/Updater.sh -O /opt/updater.sh
wget $GIT/$REPO/$BRANCH/MOTD/greetings.sh -O /etc/profile.d/greeting.sh wget $GIT/$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/