mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-13 22:02:28 +00:00
Fix regex to change gamemode value
The sed command `sed -i "/gamemode\s*=/ c gamemode=$MODE" $SERVER_PROPERTIES` matches all lines containing `gamemode=`. This includes the line `force-gamemode` that is set it with `setServerProp "force-gamemode" "$FORCE_GAMEMODE"` So basically the `force-gamemode` line is erased and the `gamemode=value` line is duplicated, and then the server cleans it up at start and deduplicates the `gamemode` line and create a new `force-gamemode` line with a default value. This fix ensures that only the `gamemode=` line is modified when changing the gamemode value.
This commit is contained in:
parent
f875af5cdb
commit
0195b42eea
1 changed files with 1 additions and 1 deletions
|
@ -526,7 +526,7 @@ if [ ! -e server.properties ]; then
|
|||
;;
|
||||
esac
|
||||
|
||||
sed -i "/gamemode\s*=/ c gamemode=$MODE" $SERVER_PROPERTIES
|
||||
sed -i "/^gamemode\s*=/ c gamemode=$MODE" $SERVER_PROPERTIES
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue