summaryrefslogtreecommitdiffstats
path: root/installer/opengnsys_update.sh
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2020-06-16 10:57:41 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-06-19 15:06:45 +0200
commitf6e87d351413b9b2b3a09ffd54d71ebc4280222a (patch)
treec411b0f639f0c572bc96b09dc5aa16286384d782 /installer/opengnsys_update.sh
parentc070d3d734648dae98f719e1f27962b489b23e7a (diff)
#981 Use new ogServer systemd unit file
This commit adapts installer, updater and init scripts to work with new ogServer systemd unit file.
Diffstat (limited to 'installer/opengnsys_update.sh')
-rwxr-xr-xinstaller/opengnsys_update.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh
index 29cdb910..ffe262d8 100755
--- a/installer/opengnsys_update.sh
+++ b/installer/opengnsys_update.sh
@@ -1092,6 +1092,25 @@ function ogServerCompilation()
grep -q "APITOKEN=" $INSTALL_TARGET/etc/ogAdmServer.cfg || \
$INSTALL_TARGET/bin/settoken -f
+ if ! diff -q \
+ "$WORKDIR"/ogServer-"$BRANCH"/cfg/ogserver.service \
+ /lib/systemd/system/ogserver.service 2>/dev/null; then
+ service="opengnsys"
+ $STOPSERVICE
+ echoAndLog "${FUNCNAME}(): updating new service file"
+ backupFile /lib/systemd/system/ogserver.service
+ service="ogadmserver"
+ $STOPSERVICE
+ cp -a \
+ "$WORKDIR"/ogServer-"$BRANCH"/cfg/ogserver.service \
+ /lib/systemd/system/ogserver.service
+ systemctl daemon-reload
+ $STARTSERVICE
+ service="opengnsys"
+ $STARTSERVICE
+ NEWFILES="$NEWFILES /lib/systemd/system/ogserver.service"
+ fi
+
return $error
}