From affce1633174aeb017439b0f263027f0f4094e1c Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Fri, 5 Jun 2020 13:14:17 +0200 Subject: #971 Add ogClient update to the update script New versions of OpenGnsys use ogClient as daemon for clients. Now update script downloads new version of ogClient from GitHub to update the code, maintaining the configuration file ogclient.json. --- installer/opengnsys_update.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'installer/opengnsys_update.sh') diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh index 853a47b9..36b3b18c 100755 --- a/installer/opengnsys_update.sh +++ b/installer/opengnsys_update.sh @@ -1151,6 +1151,30 @@ function updateClient() fi } +# Update ogClient +function updateOgClient() +{ + local ogclientUrl="https://codeload.github.com/opengnsys/ogClient/zip/$BRANCH" + + echoAndLog "${FUNCNAME}(): downloading ogClient code..." + + if ! (curl "${ogclientUrl}" -o ogclient.zip && \ + unzip -qo ogclient.zip) + then + errorAndLog "${FUNCNAME}(): "\ + "error getting ogClient code from ${ogclientUrl}" + return 1 + fi + if [ -e $INSTALL_TARGET/client/ogClient/cfg/ogclient.json ]; then + rm -f ogClient-"$BRANCH"/cfg/ogclient.json + fi + mv -f "ogClient-$BRANCH" $INSTALL_TARGET/client/ogClient + rm -f ogclient.zip + echoAndLog "${FUNCNAME}(): ogClient code was downloaded and updated" + + return 0 +} + # Comprobar permisos y ficheros. function checkFiles() { @@ -1343,6 +1367,12 @@ if [ $? -ne 0 ]; then exit 1 fi +# Update ogClient +if ! updateOgClient; then + errorAndLog "Error updating ogClient files" + exit 1 +fi + # Comprobar permisos y ficheros. checkFiles -- cgit v1.2.3-18-g5258