Fix symbolic link & always copy template file

This commit is contained in:
TuRz4m 2015-11-05 16:10:08 +01:00
parent 94f2005ba7
commit 575921cf79
2 changed files with 11 additions and 4 deletions

View file

@ -81,5 +81,8 @@ EXPOSE ${STEAMPORT} 32330 ${SERVERPORT}
VOLUME /ark
# Change the working directory to /arkd
WORKDIR /ark
# Update game launch the game.
ENTRYPOINT ["/home/steam/run.sh"]

12
run.sh
View file

@ -12,16 +12,20 @@ if [ ! -w /ark ]; then
exit 1
fi
# Change working directory to /ark to allow relative path
cd /ark
# Add a template directory to store the last version of config file
[ ! -d /ark/template ] && mkdir /ark/template
[ -f /ark/arkmanager.cfg ] && cp /home/steam/arkmanager.cfg /ark/template/arkmanager.cfg
[ -f /ark/crontab ] && cp /home/steam/crontab /ark/template/crontab
# We overwrite the template file each time
cp /home/steam/arkmanager.cfg /ark/template/arkmanager.cfg
cp /home/steam/crontab /ark/template/crontab
# Creating directory tree && symbolic link
[ ! -f /ark/arkmanager.cfg ] && cp /home/steam/arkmanager.cfg /ark/arkmanager.cfg
[ ! -d /ark/log ] && mkdir /ark/log
[ ! -d /ark/backup ] && mkdir /ark/backup
[ ! -f /ark/Game.ini ] && ln -s /ark/server/ShooterGame/Saved/Config/LinuxServer/Game.ini /ark/Game.ini
[ ! -f /ark/GameUserSettings.ini ] && ln -s /ark/server/ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini /ark/GameUserSettings.ini
[ ! -f /ark/Game.ini ] && ln -s server/ShooterGame/Saved/Config/LinuxServer/Game.ini Game.ini
[ ! -f /ark/GameUserSettings.ini ] && ln -s server/ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini GameUserSettings.ini