This repository has been archived by the owner on Aug 28, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
container_warmup.sh
executable file
·47 lines (43 loc) · 1.85 KB
/
container_warmup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# trigger migration of directories
if [ -r ./serverfiles_config/arkserver.cfg -a -n "$(ls ./serverfiles_saved/*.ark 2>/dev/null)" ]; then
echo "--> Starting migration to new 'serverfiles_saved' structure"
# migrate to new `saved` directory structure
# move saved
mkdir ./serverfiles_saved/SavedArks
mv ./serverfiles_saved/* ./serverfiles_saved/SavedArks/
rm ./serverfiles/ShooterGame/Saved/SavedArks
ln -s ../../../serverfiles_saved/SavedArks ./serverfiles/ShooterGame/Saved/SavedArks
# move Logs
mkdir ./serverfiles_saved/Logs
if [ ! -h ./serverfiles/ShooterGame/Saved/Logs ]; then
mv ./serverfiles/ShooterGame/Saved/Logs/* ./serverfiles_saved/Logs/
rmdir ./serverfiles/ShooterGame/Saved/Logs
ln -s ../../../serverfiles_saved/Logs ./serverfiles/ShooterGame/Saved/Logs
fi
# move SaveGames
mkdir ./serverfiles_saved/SaveGames
if [ ! -h ./serverfiles/ShooterGame/Saved/SaveGames ]; then
mv ./serverfiles/ShooterGame/Saved/SaveGames/* ./serverfiles_saved/SaveGames/
rmdir ./serverfiles/ShooterGame/Saved/SaveGames
ln -s ../../../serverfiles_saved/SaveGames ./serverfiles/ShooterGame/Saved/SaveGames
fi
# move config
mkdir ./serverfiles_saved/Config
mv ./serverfiles_config/* ./serverfiles_saved/Config/
if [ ! -h ./serverfiles/ShooterGame/Saved/Config ]; then
rm ./serverfiles/ShooterGame/Saved/Config
ln -s ../../../serverfiles_saved/Config ./serverfiles/ShooterGame/Saved/Config
fi
echo "--> Migration complete: you no longer need to mount 'serverfiles_config'"
fi
# trigger update_mods.sh if a mod is missing
(IFS=","; for m in $ARK_MODS; do
if [ ! -r "./serverfiles_mods/$m" ]; then
update_mods.sh
break
fi
done)
# ENV -> config
echo "Configuring mods in GameUserSettings: $ARK_MODS"
sed -i -e "s/ActiveMods=.*/ActiveMods=$ARK_MODS/" ./serverfiles_saved/Config/LinuxServer/GameUserSettings.ini