Files
HomeServerCTs/CT-Files/duplicati/Scripts/UpdateDuplicati.sh
Bram Prieshof 7a0de87698 Fixed CT's : elkarbackupALP,duplicati,OmadaV3,transfersh,hass,pihole
Github updated api and now appends a semicolon to versions, added `tr -d :` to list for url filtering
elkarbackupALP:
* Github api Fix
duplicati:
* Github api fix
* Enabled in jenkinsfile
OmadaV3:
* Added Stop command for omada after installation to avoid DB corruption
* Moved automaticaly installed dependencies to package list
transfersh:
* Github api fix
hass:
* Added Missing python modules (sqlalchemy nvhash)
mailbackup:
* Github api fix
* Moved downlading of resources to project
pihole:
*Added support for ProxmoxHelper App updater
2022-09-07 01:02:50 +02:00

20 lines
962 B
Bash

#!/bin/bash
#Get latest vesion
NewDuplicatiVer=$(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 " " |tr -d : |head -n 1)
#Compare versions to check for update
if [ "$NewDuplicatiVer" = "$(cat /opt/Duplicati-installed)" ] ; then
echo 'Duplicati up-to-date'
exit
else
echo "Updater Disabled, Newer versions not compatible"
exit 123
systemctl stop duplicati
rm -rf /opt/duplicati.bck
mv /opt/duplicati /opt/duplicati.bck
echo 'Updating Duplicati'
curl -L --retry 7 --retry-delay 5 $(curl -s https://api.github.com/repos/duplicati/duplicati/releases/tags/"$NewDuplicatiVer" | grep browser_download_url | grep .zip |grep -v signatures | sed -e s#^.*https#https# | tr -d \") -o /tmp/duplicati.zip
unzip /tmp/duplicati.zip -d /opt/duplicati
systemctl start duplicati
echo $NewDuplicatiVer > "/opt/Duplicati-installed"
fi