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.59 and 2.60

version 2.59, 2008/04/14 18:04:31 version 2.60, 2009/01/17 01:09:03
Line 9 
Line 9 
 # 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.58 2008-04-13 19:27:00 rajo Exp $  # $Platon: scripts/shell/firewall/fw-universal.sh,v 2.59 2008-04-14 18:04:31 rajo Exp $
 #  #
 # Changelog:  # Changelog:
 # 2003-10-24 - created  # 2003-10-24 - created
Line 174  unload_modules()
Line 174  unload_modules()
         fi          fi
 } # }}}  } # }}}
   
   # helper function for string padding
   str_pad_right()
   { # {{{
           num="$1";
           string="$2";
           count=$(echo -n "$string" | wc -c);
           count=$((count + 0))
           while [ $count -lt $num ]; do
                   string="$string ";
                   count=$((count + 1));
           done
           echo -n "$string"
           return;
   } # }}}
   
   pad7()  { str_pad_right  7 "$1"; }
   pad15() { str_pad_right 15 "$1"; }
   
 # print status of detected interfaces  # print status of detected interfaces
 print_iface_status()  print_iface_status()
 { # {{{  { # {{{
         # Print interfaces:          # Print interfaces:
         print_info "# iface     | IP addr       | Gateway       | broadcast     | netmask       | HW addr"          print_info "$(pad7 "# iface") | $(pad15 "IP address") | $(pad15 "Gateway") | $(pad15 "Broadcast") | $(pad15 "Netmask") | HW address";
         for iface in $interfaces; do          for iface in $interfaces; do
                 IPS="IP_$iface";                  IPS="IP_$iface";
                 for IP in ${!IPS}; do                  for IP in ${!IPS}; do
                         Gateway="Gateway_$iface"; Bcast="Bcast_$iface"; Mask="Mask_$iface"; HWaddr="HWaddr_$iface";                          Gateway="Gateway_$iface";
                         print_info "$iface      | ${IP} | ${!Gateway}   | ${!Bcast}     | ${!Mask}      | ${!HWaddr}"                          Bcast="Bcast_$iface";
                           Mask="Mask_$iface";
                           HWaddr="HWaddr_$iface";
                           print_info "$(pad7 $iface) | $(pad15 ${IP}) | $(pad15 ${!Gateway}) | $(pad15 ${!Bcast}) | $(pad15 ${!Mask}) | ${!HWaddr}";
                 done                  done
         done          done
 } # }}}  } # }}}

Legend:
Removed from v.2.59  
changed lines
  Added in v.2.60

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