Fix older installations not being updated because of existing systemd service symlink

This commit is contained in:
ronivay
2018-08-01 15:55:45 +03:00
parent 7092799914
commit 77142b63bb

View File

@@ -312,8 +312,14 @@ function InstallXO {
chown -R $XOUSER:$XOUSER /var/lib/xo-server chown -R $XOUSER:$XOUSER /var/lib/xo-server
fi fi
# fix to prevent older installations to not update because systemd service is not symlinked anymore
if [[ $(find /etc/systemd/system -type l -name "xo-server.service") ]]; then
rm -f /etc/systemd/system/xo-server.service
fi
echo echo
echo "Replacing systemd service configuration file" echo "Replacing systemd service configuration file"
/bin/cp -f $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/xo-server.service /etc/systemd/system/xo-server.service /bin/cp -f $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/xo-server.service /etc/systemd/system/xo-server.service
sleep 2 sleep 2
echo "Reloading systemd configuration" echo "Reloading systemd configuration"