Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Tuesday, March 19, 2024

Diff for scripts/shell/firewall/fw-universal.sh between version 2.105 and 2.106

version 2.105, 2015/10/19 14:00:33 version 2.106, 2016/01/17 15:03:29
Line 22 
Line 22 
 # Licensed under terms of GNU General Public License.  # Licensed under terms of GNU General Public License.
 # All rights reserved.  # All rights reserved.
 #  #
 # $Platon: scripts/shell/firewall/fw-universal.sh,v 2.104 2015/10/12 22:41:24 rajo Exp $  # $Platon: scripts/shell/firewall/fw-universal.sh,v 2.105 2015/10/19 14:00:33 nepto Exp $
 #  #
 # Changelog:  # Changelog:
 # 2003-10-24 - created  # 2003-10-24 - created
Line 39  DEFAULT_FIREWALL_CONFIG="${DEFAULT_FIREW
Line 39  DEFAULT_FIREWALL_CONFIG="${DEFAULT_FIREW
 DEFAULT_FIREWALL_CONFIG_DIR="${DEFAULT_FIREWALL_CONFIG_DIR:=/etc/default/firewall.d}"  DEFAULT_FIREWALL_CONFIG_DIR="${DEFAULT_FIREWALL_CONFIG_DIR:=/etc/default/firewall.d}"
 DEFAULT_CACHE_DIR="${DEFAULT_CACHE_DIR:=/var/cache/firewall}"  DEFAULT_CACHE_DIR="${DEFAULT_CACHE_DIR:=/var/cache/firewall}"
   
   DIST_FIREWALL_CONFIG_DIR="${DIST_FIREWALL_CONFIG_DIR:=/etc/firewall/firewall.d}"
   
 # quiet output? {{{  # quiet output? {{{
 if [ "x$1" = "xblock" ] || [ "x$QUIET" = "xyes" ]; then  if [ "x$1" = "xblock" ] || [ "x$QUIET" = "xyes" ]; then
         print_info()          print_info()
Line 1653  remote()
Line 1655  remote()
         done          done
 } # }}}  } # }}}
   
   map_subnet()
   { # {{{
           cfgvar=$1
           cfgfile=$2
           port=$3
   
           if [ -f "$DEFAULT_FIREWALL_CONFIG_DIR/subnets/$cfgfile" ]; then
                   cfgfound="$DEFAULT_FIREWALL_CONFIG_DIR/subnets/$cfgfile";
           else
                   if [ -f "$DIST_FIREWALL_CONFIG_DIR/subnets/$cfgfile" ]; then
                           cfgfound="$DIST_FIREWALL_CONFIG_DIR/subnets/$cfgfile";
                   else
                           "Config file '$cfgfile' not found"
                           exit 1
                   fi
           fi
   
           echo "Mapping $cfgfound map file to $cfgvar, port $port"
           while read subnet ; do
                   case "$subnet" in
                           ""|\#*)
                                   continue
                                   ;;
                   esac
                   echo "$cfgvar=\"\$$cfgvar $subnet:$port\"" >> "$DEFAULT_FIREWALL_CONFIG_DIR/$cfgfile"
           done < $cfgfound
   
   } # }}}
   
 # Parse output from ifconfig: - tested on Linux and FreeBSD  # Parse output from ifconfig: - tested on Linux and FreeBSD
 # http://platon.sk/cvs/cvs.php/scripts/shell/firewall/ifconfig-parse.sh  # http://platon.sk/cvs/cvs.php/scripts/shell/firewall/ifconfig-parse.sh
 parse_ifconfig()  parse_ifconfig()
Line 1913  case "$1" in
Line 1944  case "$1" in
         remote)          remote)
                 remote;                  remote;
                 ;;                  ;;
           map-subnet)
                   shift;
                   map_subnet $*;
                   ;;
         *)          *)
                 echo "Usage: $0 {start|stop|really-off|status|purge|block|deploy-block|deploy-update|update}" >&2                  echo "Usage: $0 {start|stop|really-off|status|purge|block|deploy-block|deploy-update|update}" >&2
                 exit 1                  exit 1

Legend:
Removed from v.2.105  
changed lines
  Added in v.2.106

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top