asdf
This commit is contained in:
@@ -235,39 +235,41 @@ EOF
|
||||
# 07. Main loop
|
||||
# ===================================================
|
||||
main() {
|
||||
cd "$ORIGINAL_DIR" || die "Can no longer cd to $ORIGINAL_DIR"
|
||||
while true ; do
|
||||
cd "$ORIGINAL_DIR" || die "Can no longer cd to $ORIGINAL_DIR"
|
||||
|
||||
if [ -e ./SERVER.ENV ] ; then
|
||||
. ./SERVER.ENV
|
||||
else
|
||||
die "Could not source ./SERVER.ENV"
|
||||
fi
|
||||
if [ -e ./SERVER.ENV ] ; then
|
||||
. ./SERVER.ENV
|
||||
else
|
||||
die "Could not source ./SERVER.ENV"
|
||||
fi
|
||||
|
||||
# this must be here and not up top as we must load it from the SERVER.ENV
|
||||
export SERVER_HOME="$SERVERS/$SERVER_NAME"
|
||||
# this must be here and not up top as we must load it from the SERVER.ENV
|
||||
export SERVER_HOME="$SERVERS/$SERVER_NAME"
|
||||
|
||||
# create directories in $SERVER_HOME, blank the modstring
|
||||
init_server
|
||||
# create directories in $SERVER_HOME, blank the modstring
|
||||
init_server
|
||||
|
||||
if [ -e ./serverDZ.cfg ] ; then
|
||||
cp -f ./serverDZ.cfg "$SERVER_HOME"/ || die "Failed to copy ./serverDZ into $SERVER_HOME"
|
||||
else
|
||||
die "Could not find ./serverDZ.cfg"
|
||||
fi
|
||||
if [ -e ./serverDZ.cfg ] ; then
|
||||
cp -f ./serverDZ.cfg "$SERVER_HOME"/ || die "Failed to copy ./serverDZ into $SERVER_HOME"
|
||||
else
|
||||
die "Could not find ./serverDZ.cfg"
|
||||
fi
|
||||
|
||||
# trigger update for remote server game/map/mod files
|
||||
# for this, the current machine needs to have ssh-copy-id done
|
||||
# or else will ask for password
|
||||
ssh steam@dayz-modserver 'sh /home/steam/dayz-servers/modserver_update.sh'
|
||||
# trigger update for remote server game/map/mod files
|
||||
# for this, the current machine needs to have ssh-copy-id done
|
||||
# or else will ask for password
|
||||
ssh steam@dayz-modserver 'sh /home/steam/dayz-servers/modserver_update.sh'
|
||||
|
||||
# sync remote server stock and mod files into local cache
|
||||
refresh_local_cache || die "Failed to refresh local cache."
|
||||
# sync remote server stock and mod files into local cache
|
||||
refresh_local_cache || die "Failed to refresh local cache."
|
||||
|
||||
# load stock server, map, mod files into $SERVER_HOME
|
||||
setup_environment || die "Failed to setup environment."
|
||||
# load stock server, map, mod files into $SERVER_HOME
|
||||
setup_environment || die "Failed to setup environment."
|
||||
|
||||
# START THE SERVER - RUN ServerDZ.EXE
|
||||
start_server "$@"
|
||||
# START THE SERVER - RUN ServerDZ.EXE
|
||||
start_server "$@"
|
||||
done
|
||||
}
|
||||
|
||||
main "$@" || exit 1
|
||||
|
||||
Reference in New Issue
Block a user