2021-12-07 13:50:05 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-12-07 15:29:26 +00:00
|
|
|
function symlink_client_files() {
|
2021-12-08 07:50:15 +00:00
|
|
|
echo "Creating symlinks for client files"
|
2021-12-07 15:29:26 +00:00
|
|
|
ln -s /client/client/res/macros/ /app/res/macros
|
|
|
|
ln -s /client/client/res/BrickModels/ /app/res/BrickModels
|
|
|
|
ln -s /client/client/res/chatplus_en_us.txt /app/res/chatplus_en_us.txt
|
|
|
|
ln -s /client/client/res/names/ /app/res/names
|
2021-12-08 07:50:15 +00:00
|
|
|
ln -s /client/client/res/CDServer.sqlite /app/res/CDServer.sqlite
|
2021-12-07 15:29:26 +00:00
|
|
|
ln -s /client/client/locale/locale.xml /app/locale/locale.xml
|
2021-12-08 06:44:37 +00:00
|
|
|
# need to iterate over entries in maps due to maps already being a directory with navmeshes/ in it
|
|
|
|
(
|
|
|
|
cd /client/client/res/maps
|
|
|
|
readarray -d '' entries < <(printf '%s\0' * | sort -zV)
|
|
|
|
for entry in "${entries[@]}"; do
|
|
|
|
ln -s /client/client/res/maps/$entry /app/res/maps/
|
|
|
|
done
|
|
|
|
)
|
2021-12-07 15:29:26 +00:00
|
|
|
}
|
|
|
|
|
2021-12-08 07:50:15 +00:00
|
|
|
function symlink_config_files() {
|
|
|
|
echo "Creating symlinks for config files"
|
|
|
|
rm /app/*.ini
|
|
|
|
ln -s /configs/authconfig.ini /app/authconfig.ini
|
|
|
|
ln -s /configs/chatconfig.ini /app/chatconfig.ini
|
|
|
|
ln -s /configs/masterconfig.ini /app/masterconfig.ini
|
|
|
|
ln -s /configs/worldconfig.ini /app/worldconfig.ini
|
2021-12-07 15:29:26 +00:00
|
|
|
}
|
|
|
|
|
2021-12-08 08:54:44 +00:00
|
|
|
if [[ ! -f "/app/initialized" ]]; then
|
|
|
|
# setup symlinks for volume files
|
|
|
|
symlink_client_files
|
|
|
|
symlink_config_files
|
|
|
|
# do not run symlinks more than once
|
|
|
|
touch /app/initialized
|
|
|
|
else
|
|
|
|
echo "Server already initialized"
|
|
|
|
fi
|
2021-12-07 15:29:26 +00:00
|
|
|
|
2021-12-08 07:50:15 +00:00
|
|
|
# start the server
|
2021-12-07 15:29:26 +00:00
|
|
|
echo "Start MasterServer"
|
|
|
|
./MasterServer
|
|
|
|
tail -f /dev/null
|