Index: Config
===================================================================
RCS file: /home/cmunk/ircsystems/cvsroot/unreal/Config,v
retrieving revision 1.1.1.1.4.1.2.64
diff -u -r1.1.1.1.4.1.2.64 Config
--- Config	13 May 2007 23:09:23 -0000	1.1.1.1.4.1.2.64
+++ Config	19 May 2007 09:10:43 -0000
@@ -814,26 +814,33 @@
 
 echo ""
 TEST=""
+ULIMIT="`ulimit -n`"
 while [ -z "$TEST" ] ; do
     TEST="$MAXCONNECTIONS"
     echo ""
     echo "How many file descriptors (or sockets) can the IRCd use?"
     echo $n "[$TEST] -> $c"
 	read cc
     if [ -z "$cc" ] ; then
 	MAXCONNECTIONS=$TEST
 	break
     fi
-    case "$cc" in
-	[1-9][0-9][0-9]*)
-	    MAXCONNECTIONS="$cc"
-	    ;;
-	*)
-	    echo ""
-	    echo "You must to enter a number greater than or equal to 100"
-	    TEST=""
-	    ;;
-    esac
+    if [ "$cc" -gt "$ULIMIT" ]; then
+        echo ""
+        echo "There is a limit of $ULIMIT in place.  You must enter a numbet between 100 and $ULIMIT"
+        TEST=""
+    else
+        case "$cc" in
+		[1-9][0-9][0-9]*)
+		    MAXCONNECTIONS="$cc"
+		    ;;
+		*)
+		    echo ""
+		    echo "You must to enter a number greater than or equal to 100"
+		    TEST=""
+		    ;;
+ 	   esac
+    fi
 done
 if [ -n "$ADVANCED" ] ; then
 	RUN_ADVANCED
