From c76004c330c616165ac6f09d3c4cfcc635883fd2 Mon Sep 17 00:00:00 2001 From: steven carpenter Date: Tue, 1 Jul 2025 00:17:42 -0400 Subject: [PATCH] fixed nixery --- Configs/default.json | 2 +- scripts/start.sh | 2 +- scripts/update.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100755 scripts/update.sh diff --git a/Configs/default.json b/Configs/default.json index 60c9d8e..aea3b25 100644 --- a/Configs/default.json +++ b/Configs/default.json @@ -198,5 +198,5 @@ "serverMinGrassDistance": 50, "fastValidation": true } - }, + } } diff --git a/scripts/start.sh b/scripts/start.sh index 7ae81e0..4853320 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1 +1 @@ -./ArmaReforgerServer -config ./Configs/default.json -maxFPS 60 +export NIXPKGS_ALLOW_UNFREE=1 && nix-shell -p steam-run --run "steam-run ./ArmaReforgerServer -config ./Configs/default.json -maxFPS 60" diff --git a/scripts/update.sh b/scripts/update.sh new file mode 100755 index 0000000..cb7fb4f --- /dev/null +++ b/scripts/update.sh @@ -0,0 +1,48 @@ +#!/bin/sh +set -e + +server_root_path="/home/speccon18/Documents/code/test/reforger" +config_path="$server_root_path/Configs" +start_script_path="$server_root_path/start.sh" +steamcmd_script_path="./reforger_update" + +# Step 1: Download updater script if missing +if [ ! -f "$steamcmd_script_path" ]; then + echo "Downloading reforger_update script..." + curl -L -o "$steamcmd_script_path" "https://git.skdevstudios.com/SK-Development-Studios/Ground-Zero-Conflict-Configuration/raw/branch/main/scripts/reforger_update" + chmod +x "$steamcmd_script_path" +fi + +# Step 2: Missing files — download, run steamcmd, move into root +if [ ! -d "$config_path" ] || [ ! -f "$start_script_path" ]; then + echo "Missing Configs/ or start.sh in server root." + + # Download locally + curl -L -o ./start.sh "https://git.skdevstudios.com/SK-Development-Studios/Ground-Zero-Conflict-Configuration/raw/branch/main/scripts/start.sh" + chmod +x ./start.sh + + mkdir -p ./Configs + curl -L -o ./Configs/default.json "https://git.skdevstudios.com/SK-Development-Studios/Ground-Zero-Conflict-Configuration/raw/branch/main/Configs/default.json" + + # Run steamcmd (creates root if needed) + echo "Running steamcmd to initialize server files..." + steamcmd +runscript "$(pwd)/reforger_update" + + # Then move into root + echo "Moving downloaded files into server root..." + mv ./start.sh "$server_root_path/" + mv ./Configs "$server_root_path/" + +# Step 3: Files already exist — move out, update, move back in +else + echo "Found existing Configs/ and start.sh. Backing them up..." + + mv "$start_script_path" ./start.sh + mv "$config_path" ./Configs + + steamcmd +runscript "$(pwd)/reforger_update" + + mv ./start.sh "$server_root_path/" + mv ./Configs "$server_root_path/" +fi +