fixes
This commit is contained in:
@@ -12,6 +12,7 @@ export DEBUG=false
|
|||||||
|
|
||||||
export REMOTE_DAYZ_TRUENAS_SHARE='\\dayz-truenas.local.wvr.sh\dayz'
|
export REMOTE_DAYZ_TRUENAS_SHARE='\\dayz-truenas.local.wvr.sh\dayz'
|
||||||
export REMOTE_DIR="/mnt/dayz"
|
export REMOTE_DIR="/mnt/dayz"
|
||||||
|
export REMOTE_SERVER_LOCKFILE="$REMOTE_DIR/lockfile"
|
||||||
export REMOTE_MAPS="$REMOTE_DIR/stock/maps"
|
export REMOTE_MAPS="$REMOTE_DIR/stock/maps"
|
||||||
export REMOTE_MODS="$REMOTE_DIR/mods"
|
export REMOTE_MODS="$REMOTE_DIR/mods"
|
||||||
|
|
||||||
@@ -132,5 +133,13 @@ is_network_drive_mounted() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
islocked_remote_server() {
|
||||||
|
if [ -e "$REMOTE_SERVER_LOCKFILE" ] ; then
|
||||||
|
msg "Server is not currently locked!"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
################### GLOBAL FUNCTIONS #########################
|
################### GLOBAL FUNCTIONS #########################
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ export LOCAL_STOCK="$HOME/stock"
|
|||||||
export LOCAL_STOCK_GAME="$LOCAL_STOCK/DayZ"
|
export LOCAL_STOCK_GAME="$LOCAL_STOCK/DayZ"
|
||||||
export LOCAL_STOCK_SERVER="$LOCAL_STOCK/DayZServer"
|
export LOCAL_STOCK_SERVER="$LOCAL_STOCK/DayZServer"
|
||||||
export LOCAL_MODS="$HOME/mods"
|
export LOCAL_MODS="$HOME/mods"
|
||||||
export LOCKFILE="$REMOTE_DIR/lockfile"
|
|
||||||
|
|
||||||
# ===================================================
|
# ===================================================
|
||||||
# 03. Mount network drive
|
# 03. Mount network drive
|
||||||
@@ -241,53 +240,42 @@ update_stock_maps() {
|
|||||||
|
|
||||||
####################TODO: # msg "Updating Optimized Namalsk Server PBOs"
|
####################TODO: # msg "Updating Optimized Namalsk Server PBOs"
|
||||||
|
|
||||||
# --------------------------------------------------------------------------------------------------------------------
|
msg "Updating TakistanPlus"
|
||||||
# TAKISTAN
|
steamcmd \
|
||||||
# --------------------------------------------------------------------------------------------------------------------
|
-tcp \
|
||||||
# msg "Updating TakistanPlus"
|
+force_install_dir "$LOCAL_MODS" \
|
||||||
# steamcmd \
|
+@sSteamCmdForcePlatformType windows \
|
||||||
# -tcp \
|
+@ShutdownOnFailedCommand 1 \
|
||||||
# +force_install_dir "$LOCAL_MODS" \
|
+login "$STEAM_USER" \
|
||||||
# +@sSteamCmdForcePlatformType windows \
|
+workshop_download_item \
|
||||||
# +@ShutdownOnFailedCommand 1 \
|
"$DAYZ_GAME_ID" \
|
||||||
# +login "$STEAM_USER" \
|
"$TAKISTAN_MOD_ID" \
|
||||||
# +workshop_download_item \
|
+quit
|
||||||
# "$DAYZ_GAME_ID" \
|
|
||||||
# "$TAKISTAN_MOD_ID" \
|
|
||||||
# +quit
|
|
||||||
|
|
||||||
# if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
# die "Failed to update TakistanPlus"
|
die "Failed to update TakistanPlus"
|
||||||
# fi
|
fi
|
||||||
|
|
||||||
# if [ -d "$LOCAL_MODS/steamapps/workshop/content/$DAYZ_GAME_ID/$TAKISTAN_MOD_ID/Mission/$TAKISTAN_MAP_NAME" ] ; then
|
if [ -d "$LOCAL_MODS/steamapps/workshop/content/$DAYZ_GAME_ID/$TAKISTAN_MOD_ID/Mission/$TAKISTAN_MAP_NAME" ] ; then
|
||||||
# do_sync "$LOCAL_MODS/steamapps/workshop/content/$DAYZ_GAME_ID/$TAKISTAN_MOD_ID/Mission/$TAKISTAN_MAP_NAME"/ \
|
do_sync "$LOCAL_MODS/steamapps/workshop/content/$DAYZ_GAME_ID/$TAKISTAN_MOD_ID/Mission/$TAKISTAN_MAP_NAME"/ \
|
||||||
# "$REMOTE_MAPS/$TAKISTAN_MAP_NAME" || \
|
"$REMOTE_MAPS/$TAKISTAN_MAP_NAME" || \
|
||||||
# die "failed to copy Takistan map files"
|
die "failed to copy Takistan map files"
|
||||||
# fi
|
|
||||||
# --------------------------------------------------------------------------------------------------------------------
|
|
||||||
}
|
|
||||||
|
|
||||||
islocked_remote_server() {
|
|
||||||
if [ -e "$LOCKFILE" ] ; then
|
|
||||||
msg "Server is not currently locked!"
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# =====================================================================================
|
||||||
lock_remote_server() {
|
lock_remote_server() {
|
||||||
msg "Locking remote server."
|
msg "Locking remote server."
|
||||||
if ! echo 'locked' | tee "$LOCKFILE" ; then
|
if ! echo 'locked' | tee "$REMOTE_SERVER_LOCKFILE" ; then
|
||||||
die "Could not create: $LOCKFILE"
|
die "Could not create: $REMOTE_SERVER_LOCKFILE"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
unlock_remote_server() {
|
unlock_remote_server() {
|
||||||
msg "Unlocking remote server."
|
msg "Unlocking remote server."
|
||||||
rm -f "$LOCKFILE" || die "Could not remove: $LOCKFILE"
|
rm -f "$REMOTE_SERVER_LOCKFILE" || die "Could not remove: $REMOTE_SERVER_LOCKFILE"
|
||||||
}
|
}
|
||||||
|
# =====================================================================================
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
check || die "Failed to pass health checks"
|
check || die "Failed to pass health checks"
|
||||||
@@ -299,11 +287,12 @@ main() {
|
|||||||
update_stock_maps
|
update_stock_maps
|
||||||
|
|
||||||
for server in $(ls "$MODLISTS" | xargs) ; do
|
for server in $(ls "$MODLISTS" | xargs) ; do
|
||||||
[ -f "$MODLISTS/$server" ] || continue
|
if [ ! -f "$MODLISTS/$server" ] ; then
|
||||||
|
msg "Could not find modlist for: $MODLISTS/$server"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
update_mods_for_server "$server"
|
update_mods_for_server "$server"
|
||||||
unset server
|
unset server
|
||||||
# rm -rf "$HOME/.steam/debian-installation/steamapps/workshop/downloads"
|
|
||||||
# mkdir -p "$HOME/.steam/debian-installation/steamapps/workshop/downloads"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
unlock_remote_server
|
unlock_remote_server
|
||||||
|
|||||||
Reference in New Issue
Block a user