Support Robust.Server fallback
This commit is contained in:
@@ -6,17 +6,24 @@ if [ ! "$(ls -A /ss14)" ]; then
|
||||
cp -R /ss14-default/* /ss14/
|
||||
fi
|
||||
|
||||
# Start the watchdog
|
||||
cd /ss14/publish/ || exit 1
|
||||
# Locate the watchdog binary if it exists (older builds)
|
||||
WATCHDOG_PATH=$(find /ss14 -maxdepth 4 -type f -name "SS14.Watchdog" | head -n 1)
|
||||
|
||||
if [ -x "./SS14.Watchdog" ]; then
|
||||
exec ./SS14.Watchdog "$@"
|
||||
elif [ -d "./SS14.Watchdog" ] && [ -x "./SS14.Watchdog/SS14.Watchdog" ]; then
|
||||
cd ./SS14.Watchdog || exit 1
|
||||
exec ./SS14.Watchdog "$@"
|
||||
elif [ -x "./Robust.Server" ]; then
|
||||
exec ./Robust.Server "$@"
|
||||
else
|
||||
echo "No SS14.Watchdog or Robust.Server executable found in /ss14/publish" >&2
|
||||
if [ -n "$WATCHDOG_PATH" ]; then
|
||||
WATCHDOG_DIR=$(dirname "$WATCHDOG_PATH")
|
||||
cd "$WATCHDOG_DIR" || exit 1
|
||||
chmod +x "$WATCHDOG_PATH"
|
||||
exec "$WATCHDOG_PATH" "$@"
|
||||
fi
|
||||
|
||||
# Fallback for new builds where only Robust.Server is shipped
|
||||
SERVER_PATH=$(find /ss14 -maxdepth 4 -type f -name "Robust.Server" | head -n 1)
|
||||
if [ -z "$SERVER_PATH" ]; then
|
||||
echo "No SS14.Watchdog or Robust.Server executable found under /ss14" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SERVER_DIR=$(dirname "$SERVER_PATH")
|
||||
cd "$SERVER_DIR" || exit 1
|
||||
chmod +x "$SERVER_PATH"
|
||||
exec "$SERVER_PATH" "$@"
|
||||
|
||||
Reference in New Issue
Block a user