Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions 0.18/files/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,42 @@ if [[ $GENERATE_NEW_SAVE == true ]]; then
fi
fi


if [[ -z "${FACTORIO_SERVER_ID_LOCATION:-}" ]]; then
FACTORIO_SERVER_ID_LOCATION="/factorio/config/server-id.json"
echo "Setting Default Factorio Server ID Location"
fi

if [[ -z "${FACTORIO_SERVER_ADMIN_LIST:-}" ]]; then
FACTORIO_SERVER_ADMIN_LIST="$CONFIG/server-adminlist.json"
echo "Setting Default Factorio Server admin list Location"
fi

if [[ -z "${FACTORIO_SERVER_WHITELIST:-}" ]]; then
FACTORIO_SERVER_WHITELIST="$CONFIG/server-whitelist.json"
echo "Setting Default Factorio Server whitelist Location"
fi


if [[ -z "${FACTORIO_SERVER_BANLIST:-}" ]]; then
FACTORIO_SERVER_BANLIST="$CONFIG/server-banlist.json"
echo "Setting Default Factorio Server banlist Location"
fi
mkdir -p "$(dirname "$FACTORIO_SERVER_ID_LOCATION")"
mkdir -p "$(dirname "$FACTORIO_SERVER_ADMIN_LIST")"
mkdir -p "$(dirname "$FACTORIO_SERVER_WHITELIST")"
mkdir -p "$(dirname "$FACTORIO_SERVER_BANLIST")"

FLAGS=(\
--port "$PORT" \
--server-settings "$CONFIG/server-settings.json" \
--server-banlist "$CONFIG/server-banlist.json" \
--server-banlist "$FACTORIO_SERVER_BANLIST" \
--rcon-port "$RCON_PORT" \
--server-whitelist "$CONFIG/server-whitelist.json" \
--server-whitelist "$FACTORIO_SERVER_WHITELIST" \
--use-server-whitelist \
--server-adminlist "$CONFIG/server-adminlist.json" \
--server-adminlist "$FACTORIO_SERVER_ADMIN_LIST" \
--rcon-password "$(cat "$CONFIG/rconpw")" \
--server-id /factorio/config/server-id.json \
--server-id "$FACTORIO_SERVER_ID_LOCATION" \
)

if [[ $LOAD_LATEST_SAVE == true ]]; then
Expand Down
33 changes: 29 additions & 4 deletions 1.0/files/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,41 @@ if [[ $GENERATE_NEW_SAVE == true ]]; then
fi
fi

if [[ -z "${FACTORIO_SERVER_ID_LOCATION:-}" ]]; then
FACTORIO_SERVER_ID_LOCATION="/factorio/config/server-id.json"
echo "Setting Default Factorio Server ID Location"
fi

if [[ -z "${FACTORIO_SERVER_ADMIN_LIST:-}" ]]; then
FACTORIO_SERVER_ADMIN_LIST="$CONFIG/server-adminlist.json"
echo "Setting Default Factorio Server admin list Location"
fi

if [[ -z "${FACTORIO_SERVER_WHITELIST:-}" ]]; then
FACTORIO_SERVER_WHITELIST="$CONFIG/server-whitelist.json"
echo "Setting Default Factorio Server whitelist Location"
fi


if [[ -z "${FACTORIO_SERVER_BANLIST:-}" ]]; then
FACTORIO_SERVER_BANLIST="$CONFIG/server-banlist.json"
echo "Setting Default Factorio Server banlist Location"
fi
mkdir -p "$(dirname "$FACTORIO_SERVER_ID_LOCATION")"
mkdir -p "$(dirname "$FACTORIO_SERVER_ADMIN_LIST")"
mkdir -p "$(dirname "$FACTORIO_SERVER_WHITELIST")"
mkdir -p "$(dirname "$FACTORIO_SERVER_BANLIST")"

FLAGS=(\
--port "$PORT" \
--server-settings "$CONFIG/server-settings.json" \
--server-banlist "$CONFIG/server-banlist.json" \
--server-banlist "$FACTORIO_SERVER_BANLIST" \
--rcon-port "$RCON_PORT" \
--server-whitelist "$CONFIG/server-whitelist.json" \
--server-whitelist "$FACTORIO_SERVER_WHITELIST" \
--use-server-whitelist \
--server-adminlist "$CONFIG/server-adminlist.json" \
--server-adminlist "$FACTORIO_SERVER_ADMIN_LIST" \
--rcon-password "$(cat "$CONFIG/rconpw")" \
--server-id /factorio/config/server-id.json \
--server-id "$FACTORIO_SERVER_ID_LOCATION" \
)

if [[ $LOAD_LATEST_SAVE == true ]]; then
Expand Down
33 changes: 29 additions & 4 deletions 1.1/files/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,41 @@ if [[ $GENERATE_NEW_SAVE == true ]]; then
fi
fi

if [[ -z "${FACTORIO_SERVER_ID_LOCATION:-}" ]]; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To set default values you could change this if block to

: ${FACTORIO_SERVER_ID_LOCATION:=/factorio/config/server-id.json}

Example:

: ${test:=1 2} && echo $test
1 2

: ${test:=3 4} && echo $test
1 2

The : is to make the command a nop, but the default value still gets set

FACTORIO_SERVER_ID_LOCATION="/factorio/config/server-id.json"
echo "Setting Default Factorio Server ID Location"
fi

if [[ -z "${FACTORIO_SERVER_ADMIN_LIST:-}" ]]; then
FACTORIO_SERVER_ADMIN_LIST="$CONFIG/server-adminlist.json"
echo "Setting Default Factorio Server admin list Location"
fi

if [[ -z "${FACTORIO_SERVER_WHITELIST:-}" ]]; then
FACTORIO_SERVER_WHITELIST="$CONFIG/server-whitelist.json"
echo "Setting Default Factorio Server whitelist Location"
fi


if [[ -z "${FACTORIO_SERVER_BANLIST:-}" ]]; then
FACTORIO_SERVER_BANLIST="$CONFIG/server-banlist.json"
echo "Setting Default Factorio Server banlist Location"
fi
mkdir -p "$(dirname "$FACTORIO_SERVER_ID_LOCATION")"
mkdir -p "$(dirname "$FACTORIO_SERVER_ADMIN_LIST")"
mkdir -p "$(dirname "$FACTORIO_SERVER_WHITELIST")"
mkdir -p "$(dirname "$FACTORIO_SERVER_BANLIST")"

FLAGS=(\
--port "$PORT" \
--server-settings "$CONFIG/server-settings.json" \
--server-banlist "$CONFIG/server-banlist.json" \
--server-banlist "$FACTORIO_SERVER_BANLIST" \
--rcon-port "$RCON_PORT" \
--server-whitelist "$CONFIG/server-whitelist.json" \
--server-whitelist "$FACTORIO_SERVER_WHITELIST" \
--use-server-whitelist \
--server-adminlist "$CONFIG/server-adminlist.json" \
--server-adminlist "$FACTORIO_SERVER_ADMIN_LIST" \
--rcon-password "$(cat "$CONFIG/rconpw")" \
--server-id /factorio/config/server-id.json \
--server-id "$FACTORIO_SERVER_ID_LOCATION" \
)

if [[ $LOAD_LATEST_SAVE == true ]]; then
Expand Down