mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
Merge pull request #191 from scones/fix_properly_set_ftb_properties
Fix properly set ftb properties
This commit is contained in:
commit
95416a799e
@ -53,7 +53,6 @@ if [ ! -d ${FTB_DIR} ]; then
|
|||||||
mkdir -p ${FTB_DIR}
|
mkdir -p ${FTB_DIR}
|
||||||
unzip -o ${srv_modpack} -d ${FTB_DIR} | awk '{printf "."} END {print ""}'
|
unzip -o ${srv_modpack} -d ${FTB_DIR} | awk '{printf "."} END {print ""}'
|
||||||
cp -f /data/eula.txt ${FTB_DIR}/eula.txt
|
cp -f /data/eula.txt ${FTB_DIR}/eula.txt
|
||||||
ln -snf /data/server.properties ${FTB_DIR}/server.properties
|
|
||||||
fi
|
fi
|
||||||
export FTB_SERVER_START=${FTB_DIR}/ServerStart.sh
|
export FTB_SERVER_START=${FTB_DIR}/ServerStart.sh
|
||||||
chmod a+x ${FTB_SERVER_START}
|
chmod a+x ${FTB_SERVER_START}
|
||||||
|
@ -5,20 +5,28 @@ function setServerProp {
|
|||||||
local prop=$1
|
local prop=$1
|
||||||
local var=$2
|
local var=$2
|
||||||
if [ -n "$var" ]; then
|
if [ -n "$var" ]; then
|
||||||
echo "Setting $prop to $var"
|
echo "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
|
||||||
sed -i "/$prop\s*=/ c $prop=$var" /data/server.properties
|
sed -i "/^${prop}\s*=/ c ${prop}=${var}" $SERVER_PROPERTIES
|
||||||
|
else
|
||||||
|
echo "Skip setting ${prop}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Deploy server.properties file
|
# Deploy server.properties file
|
||||||
if [ ! -e server.properties ]; then
|
if [ ! -e $SERVER_PROPERTIES ]; then
|
||||||
echo "Creating server.properties"
|
echo "Creating server.properties in ${SERVER_PROPERTIES}"
|
||||||
cp /tmp/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"
|
||||||
sed -i "/whitelist\s*=/ c whitelist=true" /data/server.properties
|
setServerProp "whitelist" "true"
|
||||||
sed -i "/white-list\s*=/ c white-list=true" /data/server.properties
|
setServerProp "white-list" "true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setServerProp "motd" "$MOTD"
|
setServerProp "motd" "$MOTD"
|
||||||
@ -54,7 +62,7 @@ if [ ! -e server.properties ]; then
|
|||||||
# check for valid values and only then set
|
# check for valid values and only then set
|
||||||
case $LEVEL_TYPE in
|
case $LEVEL_TYPE in
|
||||||
DEFAULT|FLAT|LARGEBIOMES|AMPLIFIED|CUSTOMIZED|BIOMESOP|RTG)
|
DEFAULT|FLAT|LARGEBIOMES|AMPLIFIED|CUSTOMIZED|BIOMESOP|RTG)
|
||||||
sed -i "/level-type\s*=/ c level-type=$LEVEL_TYPE" /data/server.properties
|
setServerProp "level-type" "$LEVEL_TYPE"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid LEVEL_TYPE: $LEVEL_TYPE"
|
echo "Invalid LEVEL_TYPE: $LEVEL_TYPE"
|
||||||
@ -82,8 +90,7 @@ if [ ! -e server.properties ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo "Setting difficulty to $DIFFICULTY"
|
setServerProp "difficulty" "$DIFFICULTY"
|
||||||
sed -i "/difficulty\s*=/ c difficulty=$DIFFICULTY" /data/server.properties
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$MODE" ]; then
|
if [ -n "$MODE" ]; then
|
||||||
@ -109,9 +116,10 @@ if [ ! -e server.properties ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
setServerProp "gamemode" "$MODE"
|
||||||
sed -i "/^gamemode\s*=/ c gamemode=$MODE" $SERVER_PROPERTIES
|
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "server.properties already created, skipping"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /start-minecraftFinalSetup $@
|
exec /start-minecraftFinalSetup $@
|
||||||
|
Loading…
Reference in New Issue
Block a user