Index: /scripts/etc/7dtd.conf
===================================================================
--- /scripts/etc/7dtd.conf	(revision 22)
+++ /scripts/etc/7dtd.conf	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/sh
-# Version 4
 
 # Root directory where steamcmd should be placed
Index: /scripts/etc/init.d/7dtd.sh
===================================================================
--- /scripts/etc/init.d/7dtd.sh	(revision 22)
+++ /scripts/etc/init.d/7dtd.sh	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/sh
-# Version 4
 
 ### BEGIN INIT INFO
Index: /scripts/usr/local/bin/7dtd.sh
===================================================================
--- /scripts/usr/local/bin/7dtd.sh	(revision 22)
+++ /scripts/usr/local/bin/7dtd.sh	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/bash
-# Version 4
 
 . /usr/local/lib/7dtd/common.sh
Index: /scripts/usr/local/lib/7dtd/VERSION
===================================================================
--- /scripts/usr/local/lib/7dtd/VERSION	(revision 23)
+++ /scripts/usr/local/lib/7dtd/VERSION	(revision 23)
@@ -0,0 +1,2 @@
+Current version:	6
+Last edit:	2014-05-26
Index: /scripts/usr/local/lib/7dtd/commands/backup.sh
===================================================================
--- /scripts/usr/local/lib/7dtd/commands/backup.sh	(revision 22)
+++ /scripts/usr/local/lib/7dtd/commands/backup.sh	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/bash
-# Version 5
 
 # Backups game data files.
Index: /scripts/usr/local/lib/7dtd/commands/instances.sh
===================================================================
--- /scripts/usr/local/lib/7dtd/commands/instances.sh	(revision 22)
+++ /scripts/usr/local/lib/7dtd/commands/instances.sh	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/bash
-# Version 5
 
 
@@ -52,4 +51,5 @@
 			esac
 		done
+		echo
 	fi
 	configEditAll
@@ -75,15 +75,56 @@
 		return
 	fi
-
+		
 	if [ $(isRunning "$1") -eq 0 ]; then
 		INSTANCE=$1
 		loadCurrentConfigValues "$1"
-		configEditAll
-		echo
-		configSetAutoParameters "$INSTANCE"
-		echo
-		echo "Saving"
-		saveCurrentConfigValues "$1"
-		echo "Done"
+
+		while : ; do
+			echo "What section of the config do you want to edit?"
+			local i=0
+			local sects=()
+			for S in $(listConfigEditFuncs); do
+				(( i++ ))
+				sects[$i]=$S
+				printf "  %2d: %s\n" $i "$S"
+			done
+			echo
+			echo "   W: Save and exit"
+			echo "   Q: Exit WITHOUT saving"
+
+			local SEC
+			while : ; do
+				read -p "Section number: " SEC
+				SEC=$(lowercase $SEC)
+				if [ $(isANumber $SEC) -eq 1 ]; then
+					if [ $SEC -ge 1 -a $SEC -le $i ]; then
+						break
+					fi
+				else
+					if [ "$SEC" = "q" -o "$SEC" = "w" ]; then
+						break
+					fi
+				fi
+				echo "Not a valid section number!"
+			done
+			echo
+			
+			case "$SEC" in
+				q)
+					echo "Not saving"
+					break
+					;;
+				w)
+					configSetAutoParameters "$INSTANCE"
+					echo "Saving"
+					saveCurrentConfigValues "$1"
+					echo "Done"
+					break
+					;;
+				*)
+					configEdit${sects[$SEC]}
+					echo
+			esac
+		done
 	else
 		echo "Instance $1 is currently running. Please stop it first."
Index: /scripts/usr/local/lib/7dtd/commands/start.sh
===================================================================
--- /scripts/usr/local/lib/7dtd/commands/start.sh	(revision 22)
+++ /scripts/usr/local/lib/7dtd/commands/start.sh	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/bash
-# Version 5
 
 # Tries to start the 7dtd instance.
Index: /scripts/usr/local/lib/7dtd/commands/status.sh
===================================================================
--- /scripts/usr/local/lib/7dtd/commands/status.sh	(revision 22)
+++ /scripts/usr/local/lib/7dtd/commands/status.sh	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/bash
-# Version 5
 
 # Print status of given instance.
Index: /scripts/usr/local/lib/7dtd/commands/stop.sh
===================================================================
--- /scripts/usr/local/lib/7dtd/commands/stop.sh	(revision 22)
+++ /scripts/usr/local/lib/7dtd/commands/stop.sh	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/bash
-# Version 5
 
 # Tries to stop the 7dtd instance given as first parameter.
Index: /scripts/usr/local/lib/7dtd/commands/updateengine.sh
===================================================================
--- /scripts/usr/local/lib/7dtd/commands/updateengine.sh	(revision 22)
+++ /scripts/usr/local/lib/7dtd/commands/updateengine.sh	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/bash
-# Version 5
 
 # Tries to start the 7dtd instance.
Index: /scripts/usr/local/lib/7dtd/common.sh
===================================================================
--- /scripts/usr/local/lib/7dtd/common.sh	(revision 22)
+++ /scripts/usr/local/lib/7dtd/common.sh	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/bash
-# Version 5
 
 # Provides common functions for 7dtd-scripts. Not intended to be run directly.
Index: /scripts/usr/local/lib/7dtd/help.sh
===================================================================
--- /scripts/usr/local/lib/7dtd/help.sh	(revision 22)
+++ /scripts/usr/local/lib/7dtd/help.sh	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/bash
-# Version 5
 
 genericHelp() {
Index: /scripts/usr/local/lib/7dtd/monitor-log.sh
===================================================================
--- /scripts/usr/local/lib/7dtd/monitor-log.sh	(revision 22)
+++ /scripts/usr/local/lib/7dtd/monitor-log.sh	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/bash
-# Version 5
 
 . /usr/local/lib/7dtd/common.sh
Index: /scripts/usr/local/lib/7dtd/playerlog.sh
===================================================================
--- /scripts/usr/local/lib/7dtd/playerlog.sh	(revision 22)
+++ /scripts/usr/local/lib/7dtd/playerlog.sh	(revision 23)
@@ -1,4 +1,3 @@
 #!/bin/bash
-# Version 5
 
 timestamp() {
Index: /scripts/usr/local/lib/7dtd/serverconfig.sh
===================================================================
--- /scripts/usr/local/lib/7dtd/serverconfig.sh	(revision 22)
+++ /scripts/usr/local/lib/7dtd/serverconfig.sh	(revision 23)
@@ -1,6 +1,8 @@
 #!/bin/bash
-# Version 5
 
 # Provides functions to query and validate values for serverconfig.xml
+
+#################################
+## Definition of options
 
 serverconfig_ServerPort_QueryName() {
@@ -684,5 +686,181 @@
 
 
-############
+#################################
+## Edit option functions
+
+configEditServer() {
+	local CV
+	
+	echo "Server"
+	echo "--------------------------------"
+	for CV in \
+			ServerName ServerPassword ServerIsPublic ServerPort ServerMaxPlayerCount \
+			DisableNAT \
+			; do
+		configQueryValue $CV
+		echo
+	done
+	echo
+}
+
+configEditRemoteControl() {
+	local CV
+	
+	echo "Remote control"
+	echo "--------------------------------"
+	for CV in \
+			ControlPanelEnabled ControlPanelPort ControlPanelPassword \
+			TelnetPort TelnetPassword \
+			; do
+		if [ "$CV" = "TelnetPort" ]; then
+			echo
+			echo "NOTE: Telnet will always be enabled for management purposes!"
+			echo "Make sure you block external access to this port!"
+			echo
+		fi
+		configQueryValue $CV
+		echo
+	done
+	echo
+}
+
+configEditGameType() {
+	local CV
+	
+	echo "Game type"
+	echo "--------------------------------"
+	for CV in \
+			GameName GameWorld GameMode \
+			; do
+		configQueryValue $CV
+		echo
+	done
+	echo
+}
+
+configEditGameTypeSpecific() {
+	local CV
+	
+	echo "Options for specific game types"
+	echo "--------------------------------"
+	for CV in \
+			DayCount FragLimit MatchLength RebuildMap \
+			; do
+		configQueryValue $CV
+		echo
+	done
+	echo
+}
+
+configEditGeneric() {
+	local CV
+	
+	echo "Generic options"
+	echo "--------------------------------"
+	for CV in \
+			ShowAllPlayersOnMap FriendlyFire BuildCreate \
+			BlockDurabilityModifier \
+			; do
+		configQueryValue $CV
+		echo
+	done
+	echo
+}
+
+configEditDropLoot() {
+	local CV
+	
+	echo "Drop and Loot"
+	echo "--------------------------------"
+	for CV in \
+			DropOnDeath DropOnQuit \
+			LootAbundance LootRespawnDays AirDropFrequency \
+			; do
+		configQueryValue $CV
+		echo
+	done
+	echo
+}
+
+configEditTimes() {
+	local CV
+	
+	echo "Times / Durations"
+	echo "--------------------------------"
+	for CV in \
+			CraftTimer LootTimer \
+			DayNightLength NightPercentage \
+			; do
+		configQueryValue $CV
+		echo
+	done
+	echo
+}
+
+configEditDifficulty() {
+	local CV
+	
+	echo "Difficulty"
+	echo "--------------------------------"
+	for CV in \
+			GameDifficulty ZombiesRun \
+			PlayerDamageGiven PlayerDamageRecieved EnemySenseMemory EnemySpawnMode EnemyDifficulty \
+			; do
+		configQueryValue $CV
+		echo
+	done
+	echo
+}
+
+configEditLandClaim() {
+	local CV
+	
+	echo "Land claim options"
+	echo "--------------------------------"
+	for CV in \
+			LandClaimSize LandClaimDeadZone LandClaimExpiryTime LandClaimDecayMode \
+			LandClaimOnlineDurabilityModifier LandClaimOfflineDurabilityModifier \
+			; do
+		configQueryValue $CV
+		echo
+	done
+	echo
+}
+
+configEditAll() {
+	configEditServer
+	configEditRemoteControl
+	configEditGameType
+	configEditGameTypeSpecific
+	configEditGeneric
+	configEditDropLoot
+	configEditTimes
+	configEditDifficulty
+	configEditLandClaim
+}
+
+
+
+
+
+#################################
+## Generic worker functions
+
+
+# List all defined config editing parts
+# Returns:
+#   List of config funcs
+listConfigEditFuncs() {
+	local CV
+	for CV in $(declare -F | cut -d\  -f3 | grep "^configEdit.*$"); do
+		CV=${CV#configEdit}
+		printf "%s " "$CV"
+	done
+}
+
+
+# List all defined config options
+# Returns:
+#   List of defined config options
 listConfigValues() {
 	local CV
@@ -695,6 +873,10 @@
 
 
-#  1: Option name
-#  2: Value
+# Validate the given value for the given option
+# Params:
+#   1: Option name
+#   2: Value
+# Returns:
+#   0/1: invalid/valid
 isValidOptionValue() {
 	local TYPE=$(serverconfig_$1_Type)
@@ -747,6 +929,8 @@
 }
 
-#  1: Option name
-#  2: Target variable
+# Query for the value of a single config option
+# Will be stored in $configCurrent_$1
+# Params:
+#   1: Option name
 configQueryValue() {
 	local TYPE=$(serverconfig_$1_Type)
@@ -824,4 +1008,9 @@
 }
 
+# Set parameters for current instance that have forced values:
+#  - TelnetEnabled must be set so that management scripts can work
+#  - AdminFileName is made to point to the local instance admins.xml
+#  - SaveGameFolder is made to point to the instance folder
+# Params:
 #   1: Instance name
 configSetAutoParameters() {
@@ -831,29 +1020,6 @@
 }
 
-configEditAll() {
-	local CV
-	for CV in \
-			ServerName ServerPort ServerIsPublic ServerPassword ServerMaxPlayerCount \
-			DisableNAT \
-			ControlPanelEnabled ControlPanelPort ControlPanelPassword \
-			TelnetPort TelnetPassword \
-			GameWorld GameName GameMode \
-			ShowAllPlayersOnMap FriendlyFire BuildCreate \
-			DayCount FragLimit MatchLength RebuildMap \
-			DropOnDeath DropOnQuit \
-			LootAbundance LootRespawnDays AirDropFrequency \
-			CraftTimer LootTimer \
-			DayNightLength NightPercentage \
-			GameDifficulty ZombiesRun \
-			PlayerDamageGiven PlayerDamageRecieved EnemySenseMemory EnemySpawnMode EnemyDifficulty \
-			BlockDurabilityModifier \
-			LandClaimSize LandClaimDeadZone LandClaimExpiryTime LandClaimDecayMode \
-			LandClaimOnlineDurabilityModifier LandClaimOfflineDurabilityModifier \
-			; do
-		configQueryValue $CV
-		echo
-	done
-}
-
+
+# Print currently defined config values
 printCurrentConfig() {
 	local CV
@@ -864,4 +1030,5 @@
 }
 
+# Query for an instance name (will be saved in $INSTANCE)
 readInstanceName() {
 	until [ $(isValidInstanceName "$INSTANCE") -eq 1 ]; do
@@ -877,4 +1044,5 @@
 }
 
+# Undefine the current config values
 unsetAllConfigValues() {
 	local CV
@@ -885,4 +1053,6 @@
 }
 
+# Load all config values from the config.xml of the given instance
+# Params:
 #   1: Instance name
 loadCurrentConfigValues() {
@@ -899,4 +1069,6 @@
 }
 
+# Save all config values to the config.xml of the given instance
+# Params:
 #   1: Instance name
 saveCurrentConfigValues() {
@@ -923,4 +1095,7 @@
 }
 
+# Check if the config template exists
+# Returns:
+#   0/1: no/yes
 configTemplateExists() {
 	if [ -f $SDTD_BASE/templates/config.xml ]; then
