mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 08:23:40 +02:00
- adding migrate-from-athena (copying server state over, launching services) - deletes all server files on purge
76 lines
2.3 KiB
Bash
Executable file
76 lines
2.3 KiB
Bash
Executable file
#!/bin/sh
|
|
# postinst script for vircadia-server
|
|
#
|
|
# see: dh_installdeb(1)
|
|
. ./deb-functions
|
|
|
|
set -e
|
|
|
|
# summary of how this script can be called:
|
|
# * <postinst> `configure' <most-recently-configured-version>
|
|
# * <old-postinst> `abort-upgrade' <new version>
|
|
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
|
# <new-version>
|
|
# * <postinst> `abort-remove'
|
|
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
|
# <failed-install-package> <version> `removing'
|
|
# <conflicting-package> <version>
|
|
# for details, see https://www.debian.org/doc/debian-policy/ or
|
|
# the debian-policy package
|
|
|
|
|
|
case "$1" in
|
|
configure)
|
|
ldconfig -n /opt/vircadia/lib
|
|
adduser --system --quiet --gecos "Vircadia" --home /var/lib/vircadia --group --no-create-home vircadia
|
|
mkdir -p /var/lib/vircadia
|
|
chown vircadia:vircadia /var/lib/vircadia
|
|
chmod 775 /var/lib/vircadia
|
|
if [ ! -d "/var/lib/vircadia/default" ]; then
|
|
if [ -d "/var/lib/athena" ]; then
|
|
getAthenaActive # get list of active Athena services
|
|
ATHENA_ACTIVE=$?
|
|
getAthenaEnabled # get list of enabled Athena services
|
|
ATHENA_ENABLED=$?
|
|
stopList $ATHENA_ACTIVE # shutdown active Athena servers
|
|
|
|
# copy the server files over
|
|
cp /etc/opt/athena/* /etc/opt/vircadia
|
|
cp -R /var/lib/athena/* /var/lib/vircadia
|
|
chown -R vircadia:vircadia /var/lib/vircadia/*
|
|
find /var/lib/athena -maxdepth 3 -path "*\.local/share" -execdir sh -c 'cd share; ln -s ../.. Vircadia - dev' ';'
|
|
find /var/lib/athena -maxdepth 3 -path "*\.local/share" -execdir sh -c 'cd share; ln -s ../.. Vircadia' ';'
|
|
|
|
VIRCADIA_ACTIVE=`echo $ATHENA_ACTIVE | sed 's/athena/vircadia/g'`
|
|
VIRCADIA_ENABLED=`echo $ATHENA_ENABLED | sed 's/athena/vircadia/g'`
|
|
|
|
disableList $ATHENA_ENABLED
|
|
enableList $VIRCADIA_ENABLED
|
|
startList $VIRCADIA_ACTIVE
|
|
else
|
|
/opt/vircadia/new-server default 40100
|
|
systemctl enable vircadia-server@default.target
|
|
systemctl start vircadia-server@default.target
|
|
fi
|
|
fi
|
|
;;
|
|
|
|
abort-remove|abort-deconfigure)
|
|
ldconfig -n /opt/vircadia/lib
|
|
;;
|
|
|
|
abort-upgrade)
|
|
;;
|
|
|
|
*)
|
|
echo "postinst called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# dh_installdeb will replace this with shell code automatically
|
|
# generated by other debhelper scripts.
|
|
|
|
#DEBHELPER#
|
|
|
|
exit 0
|