Merge pull request #302 from fabianvf/override-server-props

Allow user to specify that server properties be overridden on start
This commit is contained in:
Geoff Bourne 2019-04-03 17:13:01 -05:00 committed by GitHub
commit 4d45618125
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,17 +17,7 @@ function setServerProp {
fi fi
} }
# Deploy server.properties file function customizeServerProps {
if [ ! -e $SERVER_PROPERTIES ]; then
echo "Creating server.properties in ${SERVER_PROPERTIES}"
cp /tmp/server.properties $SERVER_PROPERTIES
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
export SERVER_PROPERTIES=${FTB_DIR}/server.properties
echo "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
cp /tmp/server.properties $SERVER_PROPERTIES
fi
if [ -n "$WHITELIST" ]; then if [ -n "$WHITELIST" ]; then
echo "Creating whitelist" echo "Creating whitelist"
setServerProp "whitelist" "true" setServerProp "whitelist" "true"
@ -128,6 +118,27 @@ if [ ! -e $SERVER_PROPERTIES ]; then
esac esac
setServerProp "gamemode" "$MODE" setServerProp "gamemode" "$MODE"
fi fi
}
# Deploy server.properties file
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
export SERVER_PROPERTIES=${FTB_DIR}/server.properties
echo "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
fi
if [ ! -e $SERVER_PROPERTIES ]; then
echo "Creating server.properties in ${SERVER_PROPERTIES}"
cp /tmp/server.properties $SERVER_PROPERTIES
customizeServerProps
elif [ -n "${OVERRIDE_SERVER_PROPERTIES}" ]; then
case ${OVERRIDE_SERVER_PROPERTIES^^} in
TRUE|1)
customizeServerProps
;;
*)
echo "server.properties already created, skipping"
;;
esac
else else
echo "server.properties already created, skipping" echo "server.properties already created, skipping"
fi fi