Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Sobota, 24. október 2026

Rozdiely pre scripts/shell/firewall/fw-universal.sh medzi verziami 2.122 a 2.123

verzia 2.122, 2020/09/17 18:58:29 verzia 2.123, 2023/11/08 22:29:04
Riadok 22 
Riadok 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
Riadok 772  do_ban_single_ip()
Riadok 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()
 { # {{{  { # {{{
         #          #
Riadok 1664  add_banned_ip()
Riadok 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
Riadok 2008  case "$1" in
Riadok 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:
Odstranené z verzie2.122  
zmenené riadky
  Pridané vo verzii2.123

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok