From cfe3a6f61c90f31332339e7104486478c5f8f603 Mon Sep 17 00:00:00 2001 From: imsoftware Date: Mon, 31 May 2021 04:06:52 +0200 Subject: [PATCH] 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 --- updater.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/updater.sh b/updater.sh index be51f55a..630f3702 100755 --- a/updater.sh +++ b/updater.sh @@ -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