Files
HomeServerCTs/Scripts/GetExternalResources.sh
Bram Prieshof e3424f224b CT Duplicati: Updated so latest version of Duplicati can be used
Since newer version of Duplicati doesn't include netstandard.dll, mono-devel is used instead of the runtime package.

There is talk that netstandard.dll might be repacked in a seperate or combined in a existing package.

Also disabled the official Mono apt repo since the debian repo version is compatible
2022-04-25 00:55:45 +02:00

60 lines
3.9 KiB
Bash

#!/bin/bash
#Goto ProjectRoot
cd "$( cd "$( dirname "$0" )" &> /dev/null && pwd )/.."
#Function Syntax/Usage
# GetResource <imageVariant> <NameDownloadedFile> <DownloadURL>
#NOTE: GetGithubRelease will set a variable with version of software as $<NameOfSoftware>Ver
# GetGithubRelease <imageVariant> <NameOfSoftware> <GithubUserName/GithubRepo> <VersionFileName>
GetResource () {
local Variant=$1
local FileName=$2
local GetAddr=$3
echo "Getting $FileName for $Variant"
curl -L --retry 7 --retry-delay 5 "$GetAddr" -o "CT-Files/$Variant/$FileName"
}
GetGithubRelease () {
#Alternative for update script: curl -s https://api.github.com/repos/<user>/<Repo>/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " "
local Variant=$1
local SoftwareName=$2
local GithubRepo=$3
local VersionFile=$4
echo "Getting $SoftwareName version for $Variant"
local CurrentVersion=$(curl -s https://api.github.com/repos/$GithubRepo/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ")
export "$SoftwareName"Ver=$CurrentVersion
echo $CurrentVersion > "CT-Files/$Variant/$VersionFile"
}
GetGithubRelease mysql phpmyadmin phpmyadmin/phpmyadmin phpmyadminVersion
GetResource mysql phpmyadmin.tar.gz https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-english.tar.gz
GetResource nginx acmesh.tar.gz https://codeload.github.com/acmesh-official/acme.sh/tar.gz/master
GetResource domoticz domoticz.tgz https://releases.domoticz.com/releases/release/domoticz_linux_x86_64.tgz
GetGithubRelease transfersh transfersh dutchcoders/transfer.sh transfershVersion
GetResource transfersh transfersh-linux-amd64 https://github.com/dutchcoders/transfer.sh/releases/download/"$transfershVer"/transfersh-"$transfershVer"-linux-amd64
GetResource transfersh CustomTheme.tar.gz https://git.bprieshof.nl/attachments/217475f6-76cd-4648-be2c-7d7098f23739
GetResource omadaV3 omada.deb https://static.tp-link.com/2020/202012/20201225/Omada_v3.2.14_linux_x64.deb
GetResource nextcloud nextcloud.tar.bz2 https://download.nextcloud.com/server/releases/latest.tar.bz2
GetResource aptcacherng alpine_mirrors http://dl-4.alpinelinux.org/alpine/MIRRORS.txt
curl -L --retry 7 --retry-delay 5 https://www.centos.org/download/full-mirrorlist.csv | sed 's/^.*"http:/http:/' | sed 's/".*$//' | grep ^http > CT-Files/aptcacherng/centos_mirrors
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 "$OfflineIMAPVer" > CT-Files/mailbackup/OfflineIMAP3-installed
GetResource mailbackup olim3.tar.gz https://github.com/OfflineIMAP/offlineimap3/archive/refs/tags/$OfflineIMAPVer.tar.gz -o /tmp/
GetGithubRelease mailbackup elkarbackup RainLoop/rainloop-webmail rainloop-installed
GetResource mailbackup rlcl.zip http://www.rainloop.net/repository/webmail/rainloop-community-latest.zip
git clone https://git.bprieshof.nl/Tools/MailBackup-sys.git CT-Files/mailbackup/MailBackup-sys
GetResource elkarbackupDEB rsnapshot.deb http://ftp.debian.org/debian/pool/main/r/rsnapshot/rsnapshot_1.4.2-1_all.deb
GetGithubRelease elkarbackupALP elkarbackup elkarbackup/elkarbackup Elkarbackup-installed
GetResource elkarbackupALP elkb.tar.gz https://github.com/elkarbackup/elkarbackup/archive/refs/tags/$elkarbackupVer.tar.gz -o /tmp/
##Duplicate get latest (Working with mono-devel )
duplicatiVer=$(curl -s https://api.github.com/repos/duplicati/duplicati/releases | grep 'tag_name.*' | grep 'beta' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |head -n 1)
##Duplicati get older version (Working with only the runtime installed)
#duplicatiVer="v2.0.5.1-2.0.5.1_beta_2020-01-18"
echo $duplicatiVer > "CT-Files/duplicati/duplicati-installed"
GetResource duplicati duplicati.zip $(curl -s https://api.github.com/repos/duplicati/duplicati/releases/tags/"$duplicatiVer" | grep browser_download_url | grep .zip |grep -v signatures | sed -e s#^.*https#https# | tr -d \")