diff -ur scripts.orig/functions-fw scripts/functions-fw --- scripts.orig/functions-fw 2008-07-14 19:02:45 +0400 +++ scripts/functions-fw 2009-08-30 14:33:27 +0400 @@ -173,7 +173,7 @@ local RULE local RULES if [ -f "$TABLE/$CHAIN" ] && [ -s "$TABLE/$CHAIN" ]; then - print_message -n -e "\tLoading rules for the \"$CHAIN\" chain in the \"$TABLE\" table" + print_message -n -e "${TAB}Loading rules for the \"$CHAIN\" chain in the \"$TABLE\" table" RULES=$(< "$TABLE/$CHAIN") while read RULE; do RULE=$(iptables_expand_string "$RULE") @@ -205,7 +205,7 @@ if [ -f "$TABLE/$CHAIN" ]; then if [ "$NAME" != "default" ] && [ "$3" != "flush" ]; then [ ! -s "$TABLE/$CHAIN" ] && return - print_message -n -e "\tUnloading rules for the \"$CHAIN\" chain in the \"$TABLE\" table" + print_message -n -e "${TAB}Unloading rules for the \"$CHAIN\" chain in the \"$TABLE\" table" RULES=$(tac "$TABLE/$CHAIN") while read RULE; do RULE=$(iptables_expand_string "$RULE") @@ -226,7 +226,7 @@ print_message else # Flush rules only when stop networking - print_message -e "\tFlushing the \"$CHAIN\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Flushing the \"$CHAIN\" chain in the \"$TABLE\" table" iptables_flush_chain $TABLE $CHAIN fi fi @@ -245,17 +245,17 @@ TABLE=filter [ -z "$IPTABLES_INPUT_POLICY" ] || { - print_message -e "\tSetting $IPTABLES_INPUT_POLICY policy for the \"INPUT\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting $IPTABLES_INPUT_POLICY policy for the \"INPUT\" chain in the \"$TABLE\" table" iptables_chain_policy $TABLE INPUT "$IPTABLES_INPUT_POLICY" } [ -z "$IPTABLES_FORWARD_POLICY" ] || { - print_message -e "\tSetting $IPTABLES_FORWARD_POLICY policy for the \"FORWARD\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting $IPTABLES_FORWARD_POLICY policy for the \"FORWARD\" chain in the \"$TABLE\" table" iptables_chain_policy $TABLE FORWARD "$IPTABLES_FORWARD_POLICY" } [ -z "$IPTABLES_OUTPUT_POLICY" ] || { - print_message -e "\tSetting $IPTABLES_OUTPUT_POLICY policy for the \"OUTPUT\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting $IPTABLES_OUTPUT_POLICY policy for the \"OUTPUT\" chain in the \"$TABLE\" table" iptables_chain_policy $TABLE OUTPUT "$IPTABLES_OUTPUT_POLICY" } TABLE= @@ -264,7 +264,7 @@ # Load modules if [ -f "modules" ] && [ -s "modules" ]; then while read MODULE; do - print_message -e "\tLoading module $MODULE" + print_message -e "${TAB}Loading module $MODULE" $MODPROBE "$MODULE" || print_error "Can't load module $MODULE" done < <(egrep "^[^#]" modules) fi @@ -277,7 +277,7 @@ "$TABLE/${CHAIN%.rpm*}" = "$TABLE/$CHAIN" -a "$TABLE/${CHAIN%\~}" = "$TABLE/$CHAIN" ] || continue egrep -q "([^-]\b|^)$CHAIN(\b[^-]|$)" < <(echo "$IPTABLES_SYSTEM_CHAINS") || { - print_message -e "\tCreating the \"$CHAIN\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Creating the \"$CHAIN\" chain in the \"$TABLE\" table" iptables_create_chain $TABLE $CHAIN } done @@ -317,7 +317,7 @@ fi done fi - [ "$NAME" = "default" ] || print_message -n -e "\t" + [ "$NAME" = "default" ] || print_message -n -e "${TAB}" } iptables_stop() @@ -372,7 +372,7 @@ "$TABLE/${CHAIN%.rpm*}" = "$TABLE/$CHAIN" -a "$TABLE/${CHAIN%\~}" = "$TABLE/$CHAIN" ] || continue egrep -q "([^-]\b|^)$CHAIN(\b[^-]|$)" < <(echo "$IPTABLES_SYSTEM_CHAINS") || { - print_message -e "\tDeleting the \"$CHAIN\" chain from the \"$TABLE\" table" + print_message -e "${TAB}Deleting the \"$CHAIN\" chain from the \"$TABLE\" table" iptables_delete_chain $TABLE $CHAIN } done @@ -380,22 +380,22 @@ # Unload modules if [ -f "modules" ] && [ -s "modules" ]; then while read MODULE; do - print_message -e "\tUnloading module $MODULE" + print_message -e "${TAB}Unloading module $MODULE" $MODPROBE -r "$MODULE" || print_error "Can't unload module $MODULE" done < <(tac modules|egrep "^[^#]") fi # Set ACCEPT policy if [ "$NAME" = "default" ]; then TABLE=filter - print_message -e "\tSetting ACCEPT policy for the \"INPUT\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting ACCEPT policy for the \"INPUT\" chain in the \"$TABLE\" table" iptables_chain_policy $TABLE INPUT ACCEPT - print_message -e "\tSetting ACCEPT policy for the \"FORWARD\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting ACCEPT policy for the \"FORWARD\" chain in the \"$TABLE\" table" iptables_chain_policy $TABLE FORWARD ACCEPT - print_message -e "\tSetting ACCEPT policy for the \"OUTPUT\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting ACCEPT policy for the \"OUTPUT\" chain in the \"$TABLE\" table" iptables_chain_policy $TABLE OUTPUT ACCEPT TABLE= else - print_message -n -e "\t" + print_message -n -e "${TAB}" fi } @@ -572,7 +572,7 @@ local RULE local RULES if [ -f "$TABLE/$CHAIN" ] && [ -s "$TABLE/$CHAIN" ]; then - print_message -n -e "\tLoading rules for the \"$CHAIN\" chain in the \"$TABLE\" table" + print_message -n -e "${TAB}Loading rules for the \"$CHAIN\" chain in the \"$TABLE\" table" RULES=$(< "$TABLE/$CHAIN") while read RULE; do RULE=$(ip6tables_expand_string "$RULE") @@ -604,7 +604,7 @@ if [ -f "$TABLE/$CHAIN" ]; then if [ "$NAME" != "default" ] && [ "$3" != "flush" ]; then [ ! -s "$TABLE/$CHAIN" ] && return - print_message -n -e "\tUnloading rules for the \"$CHAIN\" chain in the \"$TABLE\" table" + print_message -n -e "${TAB}Unloading rules for the \"$CHAIN\" chain in the \"$TABLE\" table" RULES=$(tac "$TABLE/$CHAIN") while read RULE; do RULE=$(ip6tables_expand_string "$RULE") @@ -625,7 +625,7 @@ print_message else # Flush rules only when stop networking - print_message -e "\tFlushing the \"$CHAIN\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Flushing the \"$CHAIN\" chain in the \"$TABLE\" table" ip6tables_flush_chain $TABLE $CHAIN fi fi @@ -644,17 +644,17 @@ TABLE=filter [ -z "$IP6TABLES_INPUT_POLICY" ] || { - print_message -e "\tSetting $IP6TABLES_INPUT_POLICY policy for the \"INPUT\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting $IP6TABLES_INPUT_POLICY policy for the \"INPUT\" chain in the \"$TABLE\" table" ip6tables_chain_policy $TABLE INPUT "$IP6TABLES_INPUT_POLICY" } [ -z "$IP6TABLES_FORWARD_POLICY" ] || { - print_message -e "\tSetting $IP6TABLES_FORWARD_POLICY policy for the \"FORWARD\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting $IP6TABLES_FORWARD_POLICY policy for the \"FORWARD\" chain in the \"$TABLE\" table" ip6tables_chain_policy $TABLE FORWARD "$IP6TABLES_FORWARD_POLICY" } [ -z "$IP6TABLES_OUTPUT_POLICY" ] || { - print_message -e "\tSetting $IP6TABLES_OUTPUT_POLICY policy for the \"OUTPUT\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting $IP6TABLES_OUTPUT_POLICY policy for the \"OUTPUT\" chain in the \"$TABLE\" table" ip6tables_chain_policy $TABLE OUTPUT "$IP6TABLES_OUTPUT_POLICY" } TABLE= @@ -663,7 +663,7 @@ # Load modules if [ -f "modules" ] && [ -s "modules" ]; then while read MODULE; do - print_message -e "\tLoading module $MODULE" + print_message -e "${TAB}Loading module $MODULE" $MODPROBE "$MODULE" || print_error "Can't load module $MODULE" done < <(egrep "^[^#]" modules) fi @@ -676,7 +676,7 @@ "$TABLE/${CHAIN%.rpm*}" = "$TABLE/$CHAIN" -a "$TABLE/${CHAIN%\~}" = "$TABLE/$CHAIN" ] || continue egrep -q "([^-]\b|^)$CHAIN(\b[^-]|$)" < <(echo "$IP6TABLES_SYSTEM_CHAINS") || { - print_message -e "\tCreating the \"$CHAIN\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Creating the \"$CHAIN\" chain in the \"$TABLE\" table" ip6tables_create_chain $TABLE $CHAIN } done @@ -716,7 +716,7 @@ fi done fi - [ "$NAME" = "default" ] || print_message -n -e "\t" + [ "$NAME" = "default" ] || print_message -n -e "${TAB}" } ip6tables_stop() @@ -771,7 +771,7 @@ "$TABLE/${CHAIN%.rpm*}" = "$TABLE/$CHAIN" -a "$TABLE/${CHAIN%\~}" = "$TABLE/$CHAIN" ] || continue egrep -q "([^-]\b|^)$CHAIN(\b[^-]|$)" < <(echo "$IP6TABLES_SYSTEM_CHAINS") || { - print_message -e "\tDeleting the \"$CHAIN\" chain from the \"$TABLE\" table" + print_message -e "${TAB}Deleting the \"$CHAIN\" chain from the \"$TABLE\" table" ip6tables_delete_chain $TABLE $CHAIN } done @@ -779,22 +779,22 @@ # Unload modules if [ -f "modules" ] && [ -s "modules" ]; then while read MODULE; do - print_message -e "\tUnloading module $MODULE" + print_message -e "${TAB}Unloading module $MODULE" $MODPROBE -r "$MODULE" || print_error "Can't unload module $MODULE" done < <(tac modules|egrep "^[^#]") fi # Set ACCEPT policy if [ "$NAME" = "default" ]; then TABLE=filter - print_message -e "\tSetting ACCEPT policy for the \"INPUT\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting ACCEPT policy for the \"INPUT\" chain in the \"$TABLE\" table" ip6tables_chain_policy $TABLE INPUT ACCEPT - print_message -e "\tSetting ACCEPT policy for the \"FORWARD\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting ACCEPT policy for the \"FORWARD\" chain in the \"$TABLE\" table" ip6tables_chain_policy $TABLE FORWARD ACCEPT - print_message -e "\tSetting ACCEPT policy for the \"OUTPUT\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting ACCEPT policy for the \"OUTPUT\" chain in the \"$TABLE\" table" ip6tables_chain_policy $TABLE OUTPUT ACCEPT TABLE= else - print_message -n -e "\t" + print_message -n -e "${TAB}" fi } @@ -925,7 +925,7 @@ local RULE local RULES if [ -f "$TABLE/$CHAIN" ] && [ -s "$TABLE/$CHAIN" ]; then - print_message -n -e "\tLoading rules for the \"$CHAIN\" chain in the \"$TABLE\" table" + print_message -n -e "${TAB}Loading rules for the \"$CHAIN\" chain in the \"$TABLE\" table" RULES=$(< "$TABLE/$CHAIN") while read RULE; do RULE=$(ebtables_expand_string "$RULE") @@ -957,7 +957,7 @@ if [ -f "$TABLE/$CHAIN" ]; then if [ "$NAME" != "default" ] && [ "$3" != "flush" ]; then [ ! -s "$TABLE/$CHAIN" ] && return - print_message -n -e "\tUnloading rules for the \"$CHAIN\" chain in the \"$TABLE\" table" + print_message -n -e "${TAB}Unloading rules for the \"$CHAIN\" chain in the \"$TABLE\" table" RULES=$(tac "$TABLE/$CHAIN") while read RULE; do RULE=$(ebtables_expand_string "$RULE") @@ -978,7 +978,7 @@ print_message else # Flush rules only when stop networking - print_message -e "\tFlushing the \"$CHAIN\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Flushing the \"$CHAIN\" chain in the \"$TABLE\" table" ebtables_flush_chain $TABLE $CHAIN fi fi @@ -997,17 +997,17 @@ TABLE=filter [ -z "$EBTABLES_INPUT_POLICY" ] || { - print_message -e "\tSetting $EBTABLES_INPUT_POLICY policy for the \"INPUT\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting $EBTABLES_INPUT_POLICY policy for the \"INPUT\" chain in the \"$TABLE\" table" ebtables_chain_policy $TABLE INPUT "$EBTABLES_INPUT_POLICY" } [ -z "$EBTABLES_FORWARD_POLICY" ] || { - print_message -e "\tSetting $EBTABLES_FORWARD_POLICY policy for the \"FORWARD\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting $EBTABLES_FORWARD_POLICY policy for the \"FORWARD\" chain in the \"$TABLE\" table" ebtables_chain_policy $TABLE FORWARD "$EBTABLES_FORWARD_POLICY" } [ -z "$EBTABLES_OUTPUT_POLICY" ] || { - print_message -e "\tSetting $EBTABLES_OUTPUT_POLICY policy for the \"OUTPUT\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting $EBTABLES_OUTPUT_POLICY policy for the \"OUTPUT\" chain in the \"$TABLE\" table" ebtables_chain_policy $TABLE OUTPUT "$EBTABLES_OUTPUT_POLICY" } TABLE= @@ -1016,7 +1016,7 @@ # Load modules if [ -f "modules" ] && [ -s "modules" ]; then while read MODULE; do - print_message -e "\tLoading module $MODULE" + print_message -e "${TAB}Loading module $MODULE" $MODPROBE "$MODULE" || print_error "Can't load module $MODULE" done < <(egrep "^[^#]" modules) fi @@ -1029,7 +1029,7 @@ "$TABLE/${CHAIN%.rpm*}" = "$TABLE/$CHAIN" -a "$TABLE/${CHAIN%\~}" = "$TABLE/$CHAIN" ] || continue egrep -q "([^-]\b|^)$CHAIN(\b[^-]|$)" < <(echo "$EBTABLES_SYSTEM_CHAINS") || { - print_message -e "\tCreating the \"$CHAIN\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Creating the \"$CHAIN\" chain in the \"$TABLE\" table" ebtables_create_chain $TABLE $CHAIN } done @@ -1069,7 +1069,7 @@ fi done fi - [ "$NAME" = "default" ] || print_message -n -e "\t" + [ "$NAME" = "default" ] || print_message -n -e "${TAB}" } ebtables_stop() @@ -1124,7 +1124,7 @@ "$TABLE/${CHAIN%.rpm*}" = "$TABLE/$CHAIN" -a "$TABLE/${CHAIN%\~}" = "$TABLE/$CHAIN" ] || continue egrep -q "([^-]\b|^)$CHAIN(\b[^-]|$)" < <(echo "$EBTABLES_SYSTEM_CHAINS") || { - print_message -e "\tDeleting the \"$CHAIN\" chain from the \"$TABLE\" table" + print_message -e "${TAB}Deleting the \"$CHAIN\" chain from the \"$TABLE\" table" ebtables_delete_chain $TABLE $CHAIN } done @@ -1132,21 +1132,21 @@ # Unload modules if [ -f "modules" ] && [ -s "modules" ]; then while read MODULE; do - print_message -e "\tUnloading module $MODULE" + print_message -e "${TAB}Unloading module $MODULE" $MODPROBE -r "$MODULE" || print_error "Can't unload module $MODULE" done < <(tac modules|egrep "^[^#]") fi # Set ACCEPT policy if [ "$NAME" = "default" ]; then TABLE=filter - print_message -e "\tSetting ACCEPT policy for the \"INPUT\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting ACCEPT policy for the \"INPUT\" chain in the \"$TABLE\" table" ebtables_chain_policy $TABLE INPUT ACCEPT - print_message -e "\tSetting ACCEPT policy for the \"FORWARD\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting ACCEPT policy for the \"FORWARD\" chain in the \"$TABLE\" table" ebtables_chain_policy $TABLE FORWARD ACCEPT - print_message -e "\tSetting ACCEPT policy for the \"OUTPUT\" chain in the \"$TABLE\" table" + print_message -e "${TAB}Setting ACCEPT policy for the \"OUTPUT\" chain in the \"$TABLE\" table" ebtables_chain_policy $TABLE OUTPUT ACCEPT TABLE= else - print_message -n -e "\t" + print_message -n -e "${TAB}" fi } diff -ur scripts.orig/network.init scripts/network.init --- scripts.orig/network.init 2008-07-14 19:02:45 +0400 +++ scripts/network.init 2009-08-30 14:33:27 +0400 @@ -134,7 +134,7 @@ local i for ((i=1; i<=$GROUP_SIZE; i++)) do IFNAME=`echo "${START_GROUP[$GROUP_ID]}" | cut -d' ' -f$i` - print_message -n -e "\tStarting $IFNAME: " + print_message -n -e "${TAB}Starting $IFNAME: " $SCRIPTDIR/ifup $IFNAME $* local rc=$? case $rc in @@ -157,7 +157,7 @@ local i for ((i=1; i<=$GROUP_SIZE; i++)) do IFNAME=`echo "${STOP_GROUP[$GROUP_ID]}" | cut -d' ' -f$i` - print_message -n -e "\tStopping $IFNAME: " + print_message -n -e "${TAB}Stopping $IFNAME: " $SCRIPTDIR/ifdown $IFNAME $* local rc=$? case $rc in @@ -420,7 +420,7 @@ for IFACEFILE in $MYIFACEDIR/*; do TESTFILE=`basename $IFACEFILE` [ "$TESTFILE" = "CVS" ] && continue - print_message -n -e "\t$NAME/$TESTFILE:" + print_message -n -e "${TAB}$NAME/$TESTFILE:" # strip optional profile suffix case ${TESTFILE//.*/} in # standalone optional files