#!/usr/bin/env bash # Start AzerothCore authserver + worldserver detached from the SSH session (nohup + disown). # Stops any already-running authserver/worldserver processes first. # # Usage: # sudo bash scripts/start-azeroth-servers.sh # AZEROTH_BIN=/path/to/azeroth-server/bin bash scripts/start-azeroth-servers.sh # # Environment: # AZEROTH_BIN — directory with authserver and worldserver (default: /home/fractured-panel/azeroth-server/bin) # AZEROTH_LOG_DIR — log directory (default: /logs) set -euo pipefail 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" if [[ ! -x "$AUTH_BIN" ]]; then echo "error: not found or not executable: $AUTH_BIN" >&2 exit 1 fi if [[ ! -x "$WORLD_BIN" ]]; then echo "error: not found or not executable: $WORLD_BIN" >&2 exit 1 fi pkill -x authserver 2>/dev/null || true pkill -x worldserver 2>/dev/null || true sleep 1 mkdir -p "$LOG_DIR" cd "$BIN_DIR" nohup "$AUTH_BIN" -c "${CONF_DIR}/authserver.conf" >>"$LOG_DIR/authserver.log" 2>&1 & disown || true sleep 2 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"