Added error handeling for init.sh

This commit is contained in:
2022-07-02 22:09:33 +02:00
parent d47e3d8ebe
commit ec7705f5fc
13 changed files with 14 additions and 16 deletions

View File

@@ -667,7 +667,7 @@ actions:
- trigger: post-files - trigger: post-files
action: |- action: |-
#!/bin/sh #!/bin/sh
ash /opt/Setup/Scripts/Init.sh ash /opt/Setup/Scripts/Init.sh || exit 1
rm /opt/Setup/Scripts/Init.sh rm /opt/Setup/Scripts/Init.sh
variants: variants:
- gitea - gitea

View File

@@ -1469,7 +1469,7 @@ actions:
- trigger: post-files - trigger: post-files
action: |- action: |-
#!/bin/sh #!/bin/sh
bash /opt/Setup/Scripts/Init.sh bash /opt/Setup/Scripts/Init.sh || exit 1
rm /opt/Setup/Scripts/Init.sh rm /opt/Setup/Scripts/Init.sh
variants: variants:
- mysql - mysql

View File

@@ -1,6 +1,6 @@
#!/bin/ash #!/bin/ash
#Get Resources #Get Resources
curl -L --retry 7 --retry-delay 5 http://dl-4.alpinelinux.org/alpine/MIRRORS.txt -o /etc/apt-cacher-ng/alpine_mirrors curl -L --retry 7 --retry-delay 5 http://dl-4.alpinelinux.org/alpine/MIRRORS.txt -o /etc/apt-cacher-ng/alpine_mirrors || exit 1
curl -L --retry 7 --retry-delay 5 https://www.centos.org/download/full-mirrorlist.csv | sed 's/^.*"http:/http:/' | sed 's/".*$//' | grep ^http > /etc/apt-cacher-ng/centos_mirrors curl -L --retry 7 --retry-delay 5 https://www.centos.org/download/full-mirrorlist.csv | sed 's/^.*"http:/http:/' | sed 's/".*$//' | grep ^http > /etc/apt-cacher-ng/centos_mirrors
#Allow apt-cacher-ng to use port 80 #Allow apt-cacher-ng to use port 80
setcap 'cap_net_bind_service=+ep' /usr/sbin/apt-cacher-ng setcap 'cap_net_bind_service=+ep' /usr/sbin/apt-cacher-ng

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
#Get Resources #Get Resources
curl -L --retry 7 --retry-delay 5 https://releases.domoticz.com/releases/release/domoticz_linux_x86_64.tgz -o "/opt/Setup/domoticz.tgz" curl -L --retry 7 --retry-delay 5 https://releases.domoticz.com/releases/release/domoticz_linux_x86_64.tgz -o "/opt/Setup/domoticz.tgz" || exit 1
#Adding service user #Adding service user
adduser --system --shell /bin/bash --group --disabled-password --home /home/domoticz domoticz adduser --system --shell /bin/bash --group --disabled-password --home /home/domoticz domoticz

View File

@@ -5,7 +5,7 @@ CurrentVersion=$(curl -s https://api.github.com/repos/duplicati/duplicati/releas
##Duplicati get older version (Working with only the runtime installed) ##Duplicati get older version (Working with only the runtime installed)
#CurrentVersion="v2.0.5.1-2.0.5.1_beta_2020-01-18" #CurrentVersion="v2.0.5.1-2.0.5.1_beta_2020-01-18"
echo $CurrentVersion > /opt/Duplicati-installed echo $CurrentVersion > /opt/Duplicati-installed
curl -L --retry 7 --retry-delay 5 $(curl -s https://api.github.com/repos/duplicati/duplicati/releases/tags/"$CurrentVersion" | grep browser_download_url | grep .zip |grep -v signatures | sed -e s#^.*https#https# | tr -d \") -o /opt/Setup/duplicati.zip curl -L --retry 7 --retry-delay 5 $(curl -s https://api.github.com/repos/duplicati/duplicati/releases/tags/"$CurrentVersion" | grep browser_download_url | grep .zip |grep -v signatures | sed -e s#^.*https#https# | tr -d \") -o /opt/Setup/duplicati.zip || exit 1
#Extract duplicati #Extract duplicati
unzip /opt/Setup/duplicati.zip -d /opt/duplicati unzip /opt/Setup/duplicati.zip -d /opt/duplicati

View File

@@ -2,7 +2,7 @@
#Get Resources #Get Resources
CurrentVersion=$(curl -s https://api.github.com/repos/elkarbackup/elkarbackup/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ") CurrentVersion=$(curl -s https://api.github.com/repos/elkarbackup/elkarbackup/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ")
echo $CurrentVersion > /opt/Elkarbackup-installed echo $CurrentVersion > /opt/Elkarbackup-installed
curl -L --retry 7 --retry-delay 5 https://github.com/elkarbackup/elkarbackup/archive/refs/tags/$CurrentVersion.tar.gz -o /opt/Setup/elkb.tar.gz curl -L --retry 7 --retry-delay 5 https://github.com/elkarbackup/elkarbackup/archive/refs/tags/$CurrentVersion.tar.gz -o /opt/Setup/elkb.tar.gz || exit 1
#Install Composer #Install Composer
EXPECTED_CHECKSUM="$(curl -L https://composer.github.io/installer.sig)" EXPECTED_CHECKSUM="$(curl -L https://composer.github.io/installer.sig)"

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
#Get Resources #Get Resources
curl -L --retry 7 --retry-delay 5 http://ftp.debian.org/debian/pool/main/r/rsnapshot/rsnapshot_1.4.2-1_all.deb -o /opt/Setup/rsnapshot.deb curl -L --retry 7 --retry-delay 5 http://ftp.debian.org/debian/pool/main/r/rsnapshot/rsnapshot_1.4.2-1_all.deb -o /opt/Setup/rsnapshot.deb || exit 1
#Install elkarbackup #Install elkarbackup
apt install /opt/Setup/rsnapshot.deb elkarbackup -y apt install /opt/Setup/rsnapshot.deb elkarbackup -y
echo "Apt intall being unable to configure elkarbackup is expected" echo "Apt intall being unable to configure elkarbackup is expected"

View File

@@ -1,13 +1,12 @@
#!/bin/ash #!/bin/ash
#Get Resources #Get Resources
curl -L --retry 7 --retry-delay 5 GetAddr -o /opt/Setup/File
git clone https://git.bprieshof.nl/Tools/MailBackup-sys.git /opt/Setup/MailBackup-sys git clone https://git.bprieshof.nl/Tools/MailBackup-sys.git /opt/Setup/MailBackup-sys
CurrentVersion=$(curl -s https://api.github.com/repos/RainLoop/rainloop-webmail/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ") CurrentVersion=$(curl -s https://api.github.com/repos/RainLoop/rainloop-webmail/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ")
OfflineIMAPVer=$(curl -s https://api.github.com/repos/OfflineIMAP/offlineimap3/tags | grep 'name.*' |head -n 1 | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ") OfflineIMAPVer=$(curl -s https://api.github.com/repos/OfflineIMAP/offlineimap3/tags | grep 'name.*' |head -n 1 | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ")
echo $CurrentVersion > /opt/Setup/rainloop-installed echo $CurrentVersion > /opt/Setup/rainloop-installed
curl -L --retry 7 --retry-delay 5 http://www.rainloop.net/repository/webmail/rainloop-community-latest.zip -o /opt/Setup/rlcl.zip curl -L --retry 7 --retry-delay 5 http://www.rainloop.net/repository/webmail/rainloop-community-latest.zip -o /opt/Setup/rlcl.zip || exit 1
echo "$OfflineIMAPVer" > CT-Files/mailbackup/OfflineIMAP3-installed echo "$OfflineIMAPVer" > CT-Files/mailbackup/OfflineIMAP3-installed
curl -L --retry 7 --retry-delay 5 https://github.com/OfflineIMAP/offlineimap3/archive/refs/tags/$OfflineIMAPVer.tar.gz -o /opt/Setup/olim3.tar.gz curl -L --retry 7 --retry-delay 5 https://github.com/OfflineIMAP/offlineimap3/archive/refs/tags/$OfflineIMAPVer.tar.gz -o /opt/Setup/olim3.tar.gz || exit 1
#Install and configure using git.bprieshof.nl MailBackup-sys #Install and configure using git.bprieshof.nl MailBackup-sys
DistoBuilderINT=true ResourceFolder=/opt/Setup ash /opt/Setup/MailBackup-sys/install.sh DistoBuilderINT=true ResourceFolder=/opt/Setup ash /opt/Setup/MailBackup-sys/install.sh

View File

@@ -2,7 +2,7 @@
#Get Resources #Get Resources
CurrentVersion=$(curl -s https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ") CurrentVersion=$(curl -s https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ")
echo $CurrentVersion > /opt/phpmyadmin-installed echo $CurrentVersion > /opt/phpmyadmin-installed
curl -L --retry 7 --retry-delay 5 "$GetAddr" -o "/opt/Setup/phpmyadmin.tar.gz" curl -L --retry 7 --retry-delay 5 https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-english.tar.gz -o "/opt/Setup/phpmyadmin.tar.gz" || exit 1
#Configure MySQL #Configure MySQL
rm -rf /etc/mysql/ /etc/my.cnf.d/ /etc/my.cnf rm -rf /etc/mysql/ /etc/my.cnf.d/ /etc/my.cnf

View File

@@ -1,6 +1,6 @@
#!/bin/ash #!/bin/ash
#Get Resources #Get Resources
curl -L --retry 7 --retry-delay 5 https://download.nextcloud.com/server/releases/latest.tar.bz2 -o /opt/Setup/nextcloud.tar.bz2 curl -L --retry 7 --retry-delay 5 https://download.nextcloud.com/server/releases/latest.tar.bz2 -o /opt/Setup/nextcloud.tar.bz2 || exit 1
#Configure Nginx #Configure Nginx
rm -rf /etc/nginx/conf.d rm -rf /etc/nginx/conf.d

View File

@@ -1,6 +1,6 @@
#!/bin/ash #!/bin/ash
#Get Resources #Get Resources
curl -L --retry 7 --retry-delay 5 https://codeload.github.com/acmesh-official/acme.sh/tar.gz/master -o /opt/Setup/Fileacmesh.tar.gz curl -L --retry 7 --retry-delay 5 https://codeload.github.com/acmesh-official/acme.sh/tar.gz/master -o /opt/Setup/Fileacmesh.tar.gz || exit 1
#Configure Nginx #Configure Nginx
mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled /etc/nginx/snippets /etc/nginx/modules-available /etc/nginx/modules-enabled /etc/nginx/snippets/ mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled /etc/nginx/snippets /etc/nginx/modules-available /etc/nginx/modules-enabled /etc/nginx/snippets/

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
#Get Resources #Get Resources
curl -L --retry 7 --retry-delay 5 https://static.tp-link.com/2020/202012/20201225/Omada_v3.2.14_linux_x64.deb -o /opt/Setup/omada.deb curl -L --retry 7 --retry-delay 5 https://static.tp-link.com/2020/202012/20201225/Omada_v3.2.14_linux_x64.deb -o /opt/Setup/omada.deb || exit 1
#Install Omada #Install Omada
apt install /opt/Setup/omada.deb -y apt install /opt/Setup/omada.deb -y
rm /opt/Setup/omada.deb rm /opt/Setup/omada.deb

View File

@@ -1,9 +1,8 @@
#!/bin/ash #!/bin/ash
#Get Resources #Get Resources
curl -L --retry 7 --retry-delay 5 GetAddr -o /opt/Setup/File
CurrentVersion=$(curl -s https://api.github.com/repos/dutchcoders/transfer.sh/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ") CurrentVersion=$(curl -s https://api.github.com/repos/dutchcoders/transfer.sh/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ")
echo $CurrentVersion > /opt/transfer.sh/Version echo $CurrentVersion > /opt/transfer.sh/Version
curl -L --retry 7 --retry-delay 5 https://github.com/dutchcoders/transfer.sh/releases/download/"$CurrentVersion"/transfersh-"$CurrentVersion"-linux-amd64 -o /opt/transfer.sh/transfersh-linux-amd64 curl -L --retry 7 --retry-delay 5 https://github.com/dutchcoders/transfer.sh/releases/download/"$CurrentVersion"/transfersh-"$CurrentVersion"-linux-amd64 -o /opt/transfer.sh/transfersh-linux-amd64 || exit 1
#Setup #Setup
addgroup transfersh addgroup transfersh