Updated Builder-GetResources and SW-updateScripts

GetExternalResources has function for geting release version from github

PhpMyadmin and elkarbackup(alpine) now have update tools
This commit is contained in:
2021-11-19 01:05:50 +00:00
parent 44ff96bbbd
commit c935713877
8 changed files with 74 additions and 16 deletions

View File

@@ -0,0 +1,19 @@
#!/bin/bash
NewPhpMyAdminVersion=$(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 " ")
if test "$NewPhpMyAdminVersion" = "$(cat /opt/phpmyadmin-installed)" ; then
echo 'PhpMyAdmin up-to-date'
exit
else
echo 'Updating PhpMyAdmin'
service phpmyadmin stop
mv /opt/PhpMyAdmin/config.inc.php /tmp/phpmyadmin.config
curl --retry 7 --retry-delay 5 -s -L https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-english.tar.gz -o /tmp/phpmya.tar.gz
tar -C /opt/PhpMyAdmin -xzf /tmp/phpmya.tar.gz --strip 1
rm -rf /tmp/phpmya.tar.gz
mv /tmp/phpmyadmin.config /opt/PhpMyAdmin/config.inc.php
echo $NewPhpMyAdminVersion > /opt/phpmyadmin-installed
service phpmyadmin start
fi