Make updater.sh more robust #898 (#979)

Integrate updater.sh changes from #898 for more robust updates e.g. for Synology, see: https://github.com/phpservermon/phpservermon/issues/898

Closes #898
This commit is contained in:
imsoftware 2021-05-31 04:06:52 +02:00 committed by GitHub
parent 88708240c7
commit cfe3a6f61c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -43,14 +43,15 @@ else
fi
# get latest version
version=$(curl -s https://api.github.com/repos/phpservermon/phpservermon/releases/latest | grep browser_download_url | cut -d '/' -f 8)
version=$(curl -s https://api.github.com/repos/phpservermon/phpservermon/releases/latest | grep tag_name | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -d '"' -f 2)
echo Downloading latest Version of PHPServerMonitor \($version\)
# get download URL
downloadfile=$(curl -s https://api.github.com/repos/phpservermon/phpservermon/releases/latest | grep "zipball" | cut -d '"' -f 4)
downloadfile=$(curl -s https://api.github.com/repos/phpservermon/phpservermon/releases/latest | grep "browser_download_url" | grep "zip\"" | cut -d ' ' -f 8 | cut -d '"' -f 2)
echo Using url $downloadfile
# download latest release
curl -Lso update.zip.keep $downloadfile
curl -sLo update.zip.keep $downloadfile
echo Save config.php
mv config.php config.php.keep