mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-15 06:42:28 +00:00
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:
commit
4d45618125
1 changed files with 22 additions and 11 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue