Files
HomeServerCTs/CT-Files/uptimekuma/Scripts/Update-UptimeKuma.sh
Bram Prieshof db2f8cc7f4 Added CT: Uptime Kuma, Fixed sudo issue whiile building
*Added CT  'Uptime Kuma'

* Added pm2-logrotate to CT nodered and z2mqtt

*Added fix for failing to build CT's that use Sudo commands.
The  new sudo version enables PTY by default,
configured to temporarily disabled it while building
2024-02-13 00:22:42 +01:00

19 lines
660 B
Bash

#!/bin/ash
#Get latest vesion
NewUptimeKumaVer=$(curl -s https://api.github.com/repos/louislam/uptime-kuma/releases | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : |head -n 1)
#Compare versions to check for update
if [ "$NewUptimeKumaVer" = "$(cd /opt/node/Uptime-Kuma ; sudo -u node git describe --tags --abbrev=0)" ] ; then
echo 'Uptime-Kuma up-to-date'
exit
else
sudo -u node ash << EOF
echo 'Updating Uptime-Kuma'
cd /opt/node/Uptime-Kuma
git fetch --all
git checkout $NewUptimeKumaVer --force
npm install --production
npm run download-dist
/usr/local/bin/pm2 restart Uptime-Kuma
EOF
fi