mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:41:10 +02:00
Testing complete (thanks to Kalila for helping!)
This commit is contained in:
parent
d8d740d369
commit
bb97592dd4
1 changed files with 16 additions and 71 deletions
|
@ -17,68 +17,6 @@ set -e
|
||||||
# for details, see https://www.debian.org/doc/debian-policy/ or
|
# for details, see https://www.debian.org/doc/debian-policy/ or
|
||||||
# the debian-policy package
|
# the debian-policy package
|
||||||
|
|
||||||
getAthenaEnabled()
|
|
||||||
{
|
|
||||||
return systemctl list-units --state=loaded \
|
|
||||||
| grep -P "(athena-assignment-client|athena-domain-server|athena-server)" \
|
|
||||||
| cut -d' ' -f 1 \
|
|
||||||
| xargs -I {} sh -c 'if systemctl is-enabled {} >/dev/null ; then echo {} ; fi' \
|
|
||||||
| paste -s -d'|'
|
|
||||||
}
|
|
||||||
|
|
||||||
getVircadiaEnabled()
|
|
||||||
{
|
|
||||||
return systemctl list-units --state=loaded \
|
|
||||||
| grep -P "(vircadia-assignment-client|vircadia-domain-server|vircadia-server)" \
|
|
||||||
| cut -d' ' -f 1 \
|
|
||||||
| xargs -I {} sh -c 'if systemctl is-enabled {} >/dev/null ; then echo {} ; fi' \
|
|
||||||
| paste -s -d'|'
|
|
||||||
}
|
|
||||||
|
|
||||||
getAthenaActive()
|
|
||||||
{
|
|
||||||
return systemctl list-units \
|
|
||||||
| grep -P "(athena-assignment-client|athena-domain-server|athena-server)" \
|
|
||||||
| cut -d' ' -f 1 \
|
|
||||||
| paste -s -d'|'
|
|
||||||
}
|
|
||||||
|
|
||||||
getVircadiaActive()
|
|
||||||
{
|
|
||||||
return systemctl list-units \
|
|
||||||
| grep -P "(vircadia-assignment-client|vircadia-domain-server|vircadia-server)" \
|
|
||||||
| cut -d' ' -f 1 \
|
|
||||||
| paste -s -d'|'
|
|
||||||
}
|
|
||||||
|
|
||||||
disableList()
|
|
||||||
{
|
|
||||||
echo $1 \
|
|
||||||
| xargs -d'|' \
|
|
||||||
| systemctl disable
|
|
||||||
}
|
|
||||||
|
|
||||||
enableList()
|
|
||||||
{
|
|
||||||
echo $1 \
|
|
||||||
| xargs -d'|' \
|
|
||||||
| systemctl enable
|
|
||||||
}
|
|
||||||
|
|
||||||
stopList()
|
|
||||||
{
|
|
||||||
echo $1 \
|
|
||||||
| xargs -d'|' \
|
|
||||||
| systemctl stop
|
|
||||||
}
|
|
||||||
|
|
||||||
startList()
|
|
||||||
{
|
|
||||||
echo $1 \
|
|
||||||
| xargs -d'|' \
|
|
||||||
| systemctl start
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
configure)
|
configure)
|
||||||
ldconfig -n /opt/vircadia/lib
|
ldconfig -n /opt/vircadia/lib
|
||||||
|
@ -88,25 +26,32 @@ case "$1" in
|
||||||
chmod 775 /var/lib/vircadia
|
chmod 775 /var/lib/vircadia
|
||||||
if [ ! -d "/var/lib/vircadia/default" ]; then
|
if [ ! -d "/var/lib/vircadia/default" ]; then
|
||||||
if [ -d "/var/lib/athena" ]; then
|
if [ -d "/var/lib/athena" ]; then
|
||||||
getAthenaActive # get list of active Athena services
|
ATHENA_ACTIVE=`systemctl list-units \
|
||||||
ATHENA_ACTIVE=$?
|
| grep -P -o "(athena-assignment-client|athena-domain-server|athena-server)\S+" \
|
||||||
getAthenaEnabled # get list of enabled Athena services
|
| paste -s -d'|' \
|
||||||
ATHENA_ENABLED=$?
|
| head -c -1`
|
||||||
stopList $ATHENA_ACTIVE # shutdown active Athena servers
|
ATHENA_ENABLED=`systemctl list-units --state=loaded \
|
||||||
|
| grep -P -o "(athena-assignment-client|athena-domain-server|athena-server)\S+" \
|
||||||
|
| xargs -I {} sh -c 'if systemctl is-enabled {} >/dev/null ; then echo {} ; fi' \
|
||||||
|
| paste -s -d'|' \
|
||||||
|
| head -c -1`
|
||||||
|
|
||||||
|
# shutdown athena servers
|
||||||
|
echo -n $ATHENA_ACTIVE | xargs -d'|' systemctl stop
|
||||||
|
|
||||||
# copy the server files over
|
# copy the server files over
|
||||||
cp /etc/opt/athena/* /etc/opt/vircadia
|
cp /etc/opt/athena/* /etc/opt/vircadia
|
||||||
cp -R /var/lib/athena/* /var/lib/vircadia
|
cp -R /var/lib/athena/* /var/lib/vircadia
|
||||||
chown -R vircadia:vircadia /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 - dev"' ';'
|
||||||
find /var/lib/athena -maxdepth 3 -path "*\.local/share" -execdir sh -c 'cd share; ln -s ../.. Vircadia' ';'
|
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_ACTIVE=`echo $ATHENA_ACTIVE | sed 's/athena/vircadia/g'`
|
||||||
VIRCADIA_ENABLED=`echo $ATHENA_ENABLED | sed 's/athena/vircadia/g'`
|
VIRCADIA_ENABLED=`echo $ATHENA_ENABLED | sed 's/athena/vircadia/g'`
|
||||||
|
|
||||||
disableList $ATHENA_ENABLED
|
echo -n $ATHENA_ENABLED | xargs -d'|' systemctl disable
|
||||||
enableList $VIRCADIA_ENABLED
|
echo -n $VIRCADIA_ENABLED | xargs -d'|' systemctl enable
|
||||||
startList $VIRCADIA_ACTIVE
|
echo -n $VIRCADIA_ACTIVE | xargs -d'|' systemctl start
|
||||||
else
|
else
|
||||||
/opt/vircadia/new-server default 40100
|
/opt/vircadia/new-server default 40100
|
||||||
systemctl enable vircadia-server@default.target
|
systemctl enable vircadia-server@default.target
|
||||||
|
|
Loading…
Reference in a new issue