=================================================================== RCS file: /home/cvsd/home/cvs/scripts/shell/firewall/fw-universal.sh,v retrieving revision 2.79 retrieving revision 2.80 diff -u -p -r2.79 -r2.80 --- scripts/shell/firewall/fw-universal.sh 2011/07/20 19:05:12 2.79 +++ scripts/shell/firewall/fw-universal.sh 2011/10/03 17:33:52 2.80 @@ -18,7 +18,7 @@ # Licensed under terms of GNU General Public License. # All rights reserved. # -# $Platon: scripts/shell/firewall/fw-universal.sh,v 2.78 2011-07-14 13:13:22 nepto Exp $ +# $Platon: scripts/shell/firewall/fw-universal.sh,v 2.79 2011-07-20 19:05:12 nepto Exp $ # # Changelog: # 2003-10-24 - created @@ -171,10 +171,26 @@ load_cache() if [ ! -d "$DEFAULT_CACHE_DIR" ]; then mkdir -p "$DEFAULT_CACHE_DIR"; + if [ "$?" -ne "0" ]; then + print_info "ERROR: unable to create cache dir in load_cache()"; + return; + fi fi - config=`cat $DEFAULT_FIREWALL_CONFIG $0 $DEFAULT_FIREWALL_CONFIG_DIR/deploy-servers.list $DEFAULT_FIREWALL_CONFIG_DIR/BANNED_IP.conf `; # config file and firewalling script - md5key=`echo "config = '$config' parsed_interfaces ='$parsed_interfaces' parsed_routes='$parsed_routes'" | md5sum | $AWK '{ print $1; }'`; + config=""; + if [ -r "$DEFAULT_FIREWALL_CONFIG" ]; then + config="$config ` cat \"$DEFAULT_FIREWALL_CONFIG\" `"; + fi + if [ -r "$0" ]; then + config="$config ` cat \"$0\" `"; + fi + if [ -r "$DEFAULT_FIREWALL_CONFIG_DIR/deploy-servers.list" ]; then + config="$config ` cat \"$DEFAULT_FIREWALL_CONFIG_DIR/deploy-servers.list\" `"; + fi + if [ -r "$DEFAULT_FIREWALL_CONFIG_DIR/BANNED_IP.conf" ]; then + config="$config ` cat \"$DEFAULT_FIREWALL_CONFIG_DIR/BANNED_IP.conf\" `"; + fi + md5key=`echo config='$config' parsed_interfaces='$parsed_interfaces' parsed_routes='$parsed_routes'\" | md5sum | $AWK '{print $1;}'`; CACHE_FILE="$DEFAULT_CACHE_DIR/$md5key" #echo "CACHE_FILE=$CACHE_FILE"