fix(scripts): update server paths for new VPS location
Start script now defaults to /home/fractured-panel/azeroth-server and passes -c flags so binaries find configs regardless of compiled-in path. Update script gains --prefix flag to override CMAKE_INSTALL_PREFIX (persisted to conf/config.sh) during rebuild. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,13 +7,15 @@
|
||||
# AZEROTH_BIN=/path/to/azeroth-server/bin bash scripts/start-azeroth-servers.sh
|
||||
#
|
||||
# Environment:
|
||||
# AZEROTH_BIN — directory with authserver and worldserver (default: /root/azeroth-server/bin)
|
||||
# AZEROTH_BIN — directory with authserver and worldserver (default: /home/fractured-panel/azeroth-server/bin)
|
||||
# AZEROTH_LOG_DIR — log directory (default: <parent of bin>/logs)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
BIN_DIR="${AZEROTH_BIN:-/root/azeroth-server/bin}"
|
||||
LOG_DIR="${AZEROTH_LOG_DIR:-$(cd "$(dirname "$BIN_DIR")" && pwd)/logs}"
|
||||
BIN_DIR="${AZEROTH_BIN:-/home/fractured-panel/azeroth-server/bin}"
|
||||
BASE_DIR="$(cd "$(dirname "$BIN_DIR")" && pwd)"
|
||||
LOG_DIR="${AZEROTH_LOG_DIR:-${BASE_DIR}/logs}"
|
||||
CONF_DIR="${BASE_DIR}/etc"
|
||||
|
||||
AUTH_BIN="${BIN_DIR}/authserver"
|
||||
WORLD_BIN="${BIN_DIR}/worldserver"
|
||||
@@ -35,15 +37,16 @@ mkdir -p "$LOG_DIR"
|
||||
|
||||
cd "$BIN_DIR"
|
||||
|
||||
nohup "$AUTH_BIN" >>"$LOG_DIR/authserver.log" 2>&1 &
|
||||
nohup "$AUTH_BIN" -c "${CONF_DIR}/authserver.conf" >>"$LOG_DIR/authserver.log" 2>&1 &
|
||||
disown || true
|
||||
|
||||
sleep 2
|
||||
|
||||
nohup "$WORLD_BIN" >>"$LOG_DIR/worldserver.log" 2>&1 &
|
||||
nohup "$WORLD_BIN" -c "${CONF_DIR}/worldserver.conf" >>"$LOG_DIR/worldserver.log" 2>&1 &
|
||||
disown || true
|
||||
|
||||
echo "Started authserver and worldserver (survives SSH disconnect)."
|
||||
echo "Bin: $BIN_DIR"
|
||||
echo "Config: $CONF_DIR"
|
||||
echo "Logs: $LOG_DIR/authserver.log"
|
||||
echo " $LOG_DIR/worldserver.log"
|
||||
|
||||
@@ -35,6 +35,7 @@ FULL_BUILD=0
|
||||
COMPILE_ONLY=0
|
||||
DRY_RUN=0
|
||||
DO_RUN_AFTER=0
|
||||
INSTALL_PREFIX=""
|
||||
POST_UPDATE_CMD="${FRACTURED_POST_UPDATE_CMD:-}"
|
||||
GIT_REMOTE="${FRACTURED_GIT_REMOTE:-origin}"
|
||||
|
||||
@@ -49,6 +50,7 @@ Options:
|
||||
--no-pull Skip git pull (only compile current tree).
|
||||
--full ./acore.sh compiler all (clean + configure + compile).
|
||||
--compile-only ./acore.sh compiler compile (incremental).
|
||||
--prefix PATH Override CMAKE_INSTALL_PREFIX (updates conf/config.sh BINPATH).
|
||||
--dry-run Print commands without running them.
|
||||
--run-after [CMD] Run shell command after successful compile. If CMD is omitted,
|
||||
uses FRACTURED_POST_UPDATE_CMD from the environment.
|
||||
@@ -87,6 +89,15 @@ while [[ $# -gt 0 ]]; do
|
||||
COMPILE_ONLY=1
|
||||
shift
|
||||
;;
|
||||
--prefix)
|
||||
shift
|
||||
if [[ $# -eq 0 || "$1" == -* ]]; then
|
||||
echo "error: --prefix requires a path argument" >&2
|
||||
exit 2
|
||||
fi
|
||||
INSTALL_PREFIX="$1"
|
||||
shift
|
||||
;;
|
||||
--dry-run)
|
||||
DRY_RUN=1
|
||||
shift
|
||||
@@ -129,6 +140,16 @@ fi
|
||||
|
||||
cd "$ROOT"
|
||||
|
||||
if [[ -n "$INSTALL_PREFIX" ]]; then
|
||||
echo "==> updating conf/config.sh BINPATH to: $INSTALL_PREFIX"
|
||||
if grep -q '^BINPATH=' conf/config.sh; then
|
||||
run sed -i "s|^BINPATH=.*|BINPATH=\"$INSTALL_PREFIX\"|" conf/config.sh
|
||||
else
|
||||
echo "BINPATH=\"$INSTALL_PREFIX\"" >> conf/config.sh
|
||||
fi
|
||||
export BINPATH="$INSTALL_PREFIX"
|
||||
fi
|
||||
|
||||
if [[ "$DO_RUN_AFTER" -eq 1 && -z "${POST_UPDATE_CMD// }" ]]; then
|
||||
echo "error: --run-after needs a command or FRACTURED_POST_UPDATE_CMD set in the environment." >&2
|
||||
exit 2
|
||||
|
||||
Reference in New Issue
Block a user