Index: scripts/usr/local/bin/7dtd-common.sh
===================================================================
--- scripts/usr/local/bin/7dtd-common.sh	(revision 12)
+++ scripts/usr/local/bin/7dtd-common.sh	(revision 13)
@@ -1,4 +1,4 @@
 #!/bin/bash
-# Version 1
+# Version 2
 
 # Provides common functions for 7dtd-scripts. Not intended to be run directly.
@@ -52,4 +52,19 @@
 }
 
+# Get the PID of the instance if it is running, 0 otherwise
+# Params:
+#   1: Instance name
+# Returns:
+#   0 if not running
+#   PID otherwise
+getInstancePID() {
+	run=$(isRunning $1)
+	if [ $run -eq 1 ]; then
+		cat $(getInstancePath $1)/7dtd.pid
+	else
+		echo 0
+	fi
+}
+
 # Get a single value from a serverconfig
 # Params:
Index: scripts/usr/local/bin/7dtd-instances.sh
===================================================================
--- scripts/usr/local/bin/7dtd-instances.sh	(revision 12)
+++ scripts/usr/local/bin/7dtd-instances.sh	(revision 13)
@@ -1,4 +1,4 @@
 #!/bin/bash
-# Version 1
+# Version 2
 
 # Lists available 7dtd instances.
@@ -9,22 +9,104 @@
 checkRootLoadConf
 
-printf "%-*s | %-*s | %-*s\n" 20 "Instance name" 8 "Running" 7 "Players"
-printf -v line "%*s-+-%*s-+-%*s\n" 20 " " 8 " " 7 " "
-echo ${line// /-}
-for I in $SDTD_BASE/instances/*; do
-	ins=`basename $I`
-	run=$(isRunning $ins)
-	if [ $run -eq 1 ]; then
-		run="yes"
-		tel=$(telnetCommand $ins lp)
+listInstances() {
+	printf "%-*s | %-*s | %-*s | %-*s\n" 20 "Instance name" 8 "Running" 7 "Players" 5 "Port"
+	printf -v line "%*s-+-%*s-+-%*s-+-%*s\n" 20 " " 8 " " 7 " " 5 " "
+	echo ${line// /-}
+	for I in $SDTD_BASE/instances/*; do
+		ins=`basename $I`
+		run=$(isRunning $ins)
+		if [ $run -eq 1 ]; then
+			run="yes"
+			tel=$(telnetCommand $ins lp)
+			cur=`echo $tel | sed "s/\r/\n/g" | sed "s/^ //g" | grep "Total of " | cut -d\  -f 3`
+		else
+			run="no"
+			cur=0
+		fi
+
+		max=$(getConfigValue $ins ServerMaxPlayerCount)
+		port=$(getConfigValue $ins ServerPort)
+
+		printf "%-*s | %*s |   %2d/%2d | %5d\n" 20 "$ins" 8 "$run" $cur $max $port
+	done
+	exit 0
+}
+
+showInfo() {
+	if [ -z $1 ]; then
+		echo "Missing parameter <instance>"
+		exit 1
+	fi
+	checkInstance $1
+
+	line() {
+		printf "    %-*s %s\n" 15 "$1" "$2"
+	}
+	
+	echo
+
+	echo "7dtd instance: $1"
+	echo
+
+	res=$(isRunning $1)
+	if [ $res -eq 1 ]; then
+		echo "Status: Running"
+		echo "Open ports:"
+		netstat -nlp | grep $(getInstancePID $1) | sed -r 's/^([^ ]*)\s+.*[^ :]*:([^ ]*).*[^ :]*:[^ ]*.*/    \2 (\1)/g' | sort
+		tel=$(telnetCommand $1 lp)
 		cur=`echo $tel | sed "s/\r/\n/g" | sed "s/^ //g" | grep "Total of " | cut -d\  -f 3`
+		echo "Players: $cur"
 	else
-		run="no"
-		cur=0
+		echo "Status: NOT running"
 	fi
 
-	max=$(getConfigValue $ins ServerMaxPlayerCount)
-	
-	printf "%-*s | %*s |   %2d/%2d\n" 20 "$ins" 8 "$run" $cur $max
-done
-exit 0
+	echo
+	echo "Game info:"
+	line "Server name:" $(getConfigValue $1 ServerName)
+	line "Password:" $(getConfigValue $1 ServerPassword)
+	line "Max players:" $(getConfigValue $1 ServerMaxPlayerCount)
+	line "World:" $(getConfigValue $1 GameWorld)
+
+	echo
+	echo "Network info:"
+	line "Port:" $(getConfigValue $1 ServerPort)
+	line "Public:" $(getConfigValue $1 ServerIsPublic)
+	if [ "$(getConfigValue $1 ControlPanelEnabled)" = "false" ]; then
+		cp="off"
+	else
+		cp="Port $(getConfigValue $1 ControlPanelPort), Pass $(getConfigValue $1 ControlPanelPassword)"
+	fi
+	line "Control Panel:" "$cp"
+	if [ "$(getConfigValue $1 TelnetEnabled)" = "false" ]; then
+		tn="off"
+	else
+		tn="Port $(getConfigValue $1 TelnetPort), Pass $(getConfigValue $1 TelnetPassword)"
+	fi
+	line "Telnet:" "$tn"
+
+	echo
+	exit 0
+}
+
+showHelp() {
+	name=`basename $0`
+	echo "Unknown parameter: $1"
+	echo "Usage:"
+	echo "  $name [list]          - List all instances"
+	echo "  $name show <instance> - Show detailed info on the given instance"
+	exit 0
+}
+
+COMMAND=${1:-list}
+
+case "$COMMAND" in
+	list)
+		listInstances
+	;;
+	show)
+		showInfo $2
+	;;
+	*)
+		showHelp $COMMAND
+esac
+exit 1
