Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, December 4, 2026

Diff for scripts/shell/firewall/fw-universal.sh between version 2.122 and 2.123

version 2.122, 2020/09/17 18:58:29 version 2.123, 2023/11/08 22:29:04
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.121 2019/10/08 22:25:30 nepto Exp $  # $Platon: scripts/shell/firewall/fw-universal.sh,v 2.122 2020/09/17 18:58:29 nepto Exp $
 #  #
 # Changelog:  # Changelog:
 # 2003-10-24 - created  # 2003-10-24 - created
Line 772  do_ban_single_ip()
Line 772  do_ban_single_ip()
         done          done
 } # }}}  } # }}}
   
   do_unban_single_ip()
   { # {{{
           if [ -z "$1" ]; then
                   print_info "do_unban_single_ip(): empty banned_ip";
                   return;
           fi
           for banned_ip in $*; do
                   $IPTABLES -D INPUT -s $banned_ip -j DROP;
           done
   } # }}}
   
 bann_ip_adresses()  bann_ip_adresses()
 { # {{{  { # {{{
         #          #
Line 1664  add_banned_ip()
Line 1675  add_banned_ip()
         rm -f $TMPFILE          rm -f $TMPFILE
 } # }}}  } # }}}
   
   del_banned_ip()
   { # {{{
           for IP in $*; do
                   LINE=`sed -n "\|^${IP}|=" $DEFAULT_FIREWALL_CONFIG_DIR/BANNED_IP.conf`;
                   sed -i.bak "$((LINE-1)),$((LINE))d" $DEFAULT_FIREWALL_CONFIG_DIR/BANNED_IP.conf;
           done
   } # }}}
   
 deploy_block()  deploy_block()
 { # {{{  { # {{{
         if [ -z "$*" ]; then          if [ -z "$*" ]; then
Line 2008  case "$1" in
Line 2027  case "$1" in
                         fi                          fi
                 done                  done
                 ;;                  ;;
           unblock)
                   shift;
                   for banned_ip in $*; do
                           check_banned_ip "$banned_ip";
                           if [ "$?" -eq 0 ]; then
                                   print_info "Unblocking IP address: $banned_ip";
                                   del_banned_ip "$banned_ip";
                                   do_unban_single_ip "$banned_ip";
                           else
                                   print_info "IP address is not blocked: $banned_ip";
                                   retcode=1;
                           fi
                   done
                   ;;
         update)          update)
                 update;                  update;
                 ;;                  ;;

Legend:
Removed from v.2.122  
changed lines
  Added in v.2.123

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