Here's a better patch which can include directories in locations other
than /etc/shorewall

--- functions.orig	2006-11-18 17:40:07.000000000 +0000
+++ functions	2007-07-12 18:45:56.547172489 +0100
@@ -228,13 +228,14 @@
 	    echo $1
 	    ;;
 	*)
-	    if [ -n "$SHOREWALL_DIR" -a -f $SHOREWALL_DIR/$1 ]; then
+	    if [ -n "$SHOREWALL_DIR" \
+                 -a \( -f $SHOREWALL_DIR/$1 -o -d $SHOREWALL_DIR/$1 \) ]; then
 		echo $SHOREWALL_DIR/$1
 	    else
 		saveifs=$IFS
 		IFS=:
 		for directory in $CONFIG_PATH; do
-		    if [ -f $directory/$1 ]; then
+		    if [ -f $directory/$1 -o -d $directory/$1 ]; then
 			echo $directory/$1
 			IFS=$saveifs
 			return
@@ -1856,7 +1857,17 @@
 	while read first rest; do
 	    if [ "x$first"  = "xINCLUDE" ]; then
 		if [ $2 -lt 4 ]; then
-		    read_file $(find_file $(expand ${rest%#*})) $(($2 + 1))
+		    file=$(find_file $(expand ${rest%#*}))
+		    if [ -d "$file" ]; then
+			for each in "$file"/*;
+			do
+			  if [ -e "$each" ]; then  # Allow empty directories
+			      read_file "$each" $2 # Don't increment counter
+			  fi
+			done
+		    else
+			read_file $(find_file $(expand ${rest%#*})) $(($2 + 1))
+		    fi
 		else
 		    error_message "WARNING: INCLUDE in $1 ignored (nested too deeply)"
 		fi
Matthew

-- 
I must take issue with the term "a mere child", for it has been my
invariable experience that the company of a mere child is infinitely
preferable to that of a mere adult.
                                           --  Fran Lebowitz

Reply via email to