This commit is contained in:
2023-11-25 07:57:29 -06:00
parent 81dcff095f
commit a604dd7cf0

View File

@@ -116,8 +116,8 @@ update_mods_for_server() {
mods_file="$MODLISTS/$1" mods_file="$MODLISTS/$1"
map_name=${1%.txt} map_name=${1%.txt}
map_mod_dir="$REMOTE_MODS/$map_name" remote_map_mod_dir="$REMOTE_MODS/$map_name"
mkdir -p "$map_mod_dir" mkdir -p "$remote_map_mod_dir"
# Create temporary file to list all the mod_id's we are # Create temporary file to list all the mod_id's we are
# going to download. This speeds up steamcmd and avoids rate limits. # going to download. This speeds up steamcmd and avoids rate limits.
@@ -185,16 +185,16 @@ update_mods_for_server() {
if [ ! -d "$LOCAL_MODS/steamapps/workshop/content/$DAYZ_GAME_ID/$mod_id" ] ; then if [ ! -d "$LOCAL_MODS/steamapps/workshop/content/$DAYZ_GAME_ID/$mod_id" ] ; then
die "$LOCAL_MODS/steamapps/workshop/content/$DAYZ_GAME_ID/$mod_id does not exist" die "$LOCAL_MODS/steamapps/workshop/content/$DAYZ_GAME_ID/$mod_id does not exist"
fi fi
do_sync "$LOCAL_MODS/steamapps/workshop/content/$DAYZ_GAME_ID/$mod_id"/ "$mods_to_copy/@${mod_name}" cp -raf "$LOCAL_MODS/steamapps/workshop/content/$DAYZ_GAME_ID/$mod_id" "$mods_to_copy/@${mod_name}"
printf '@%s\n' "$mod_name" >> "$mods_to_copy/mods.txt" printf '@%s\n' "$mod_name" >> "$mods_to_copy/mods.txt"
esac esac
done < "$mods_file" done < "$mods_file"
msg "----------- SYNCING MODS -------------" msg "----------- SYNCING MODS -------------"
do_sync "$mods_to_copy"/ "$map_mod_dir" do_sync "$mods_to_copy"/ "$remote_map_mod_dir"
rm -f "$tempfile" 2>/dev/null ||: rm -f "$tempfile" 2>/dev/null ||:
unset tempfile mod map_name mods_file mods_to_copy mod_name mod_id map_mod_dir unset tempfile mod map_name mods_file mods_to_copy mod_name mod_id remote_map_mod_dir
msg "======= DONE UPDATING MODS FOR: $1 ========" msg "======= DONE UPDATING MODS FOR: $1 ========"
} }