43 lines
1.3 KiB
Bash
Executable File
43 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
source_dir="${EQL_GAME_PATH:-${HOME}/Games/EverQuestLegends}"
|
|
script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
if [[ ! -d "${source_dir}" ]]; then
|
|
echo "Error: EverQuest Legends directory not found: ${source_dir}" >&2
|
|
echo "Set EQL_GAME_PATH to the game install directory." >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -f "${source_dir}/eqclient.ini" ]]; then
|
|
echo "Error: eqclient.ini not found in ${source_dir}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
shopt -s nullglob
|
|
player_configs=(
|
|
"${source_dir}"/[!_]*_*.ini
|
|
)
|
|
|
|
# The client creates Backup_N copies while saving layouts. They are transient
|
|
# snapshots, not the current configuration we track.
|
|
configs=("${source_dir}/eqclient.ini")
|
|
for config in "${player_configs[@]}"; do
|
|
[[ "$(basename -- "${config}")" == *Backup* ]] && continue
|
|
configs+=("${config}")
|
|
done
|
|
|
|
# Player settings use Character_Server.ini, Character_Server_Class.ini, and
|
|
# UI_Character_Server_Class.ini names. Launcher INIs do not match this shape.
|
|
|
|
for config in "${configs[@]}"; do
|
|
destination="${script_dir}/$(basename -- "${config}")"
|
|
cp -- "${config}" "${destination}"
|
|
chmod 0644 "${destination}"
|
|
echo "Updated eql/$(basename -- "${config}")"
|
|
done
|
|
|
|
echo "Captured ${#configs[@]} config file(s) from ${source_dir}"
|