Changes

From SME Server
Jump to navigationJump to search
5 bytes removed ,  17:52, 11 December 2015
Line 154: Line 154:     
  nano /root/checklist_ban
 
  nano /root/checklist_ban
   
  #!/bin/bash
 
  #!/bin/bash
 
  #lancer le script en sudo  
 
  #lancer le script en sudo  
  JAILS=$(fail2ban-client status | grep " Jail list:" | sed 's/`- Jail list:\t\t//g' | sed 's/,//g')
+
  JAILS=$(fail2ban-client status | grep " Jail list:" | sed 's/`- Jail list://g' | sed 's/,//g')
 
  for j in $JAILS
 
  for j in $JAILS
 
  do
 
  do
 
  echo "$j $(fail2ban-client status $j | grep " Currently banned:" | sed 's/  |- Currently banned:\t//g')"
 
  echo "$j $(fail2ban-client status $j | grep " Currently banned:" | sed 's/  |- Currently banned:\t//g')"
 
  done
 
  done
 +
    
  chmod 700 /root/checklist_ban
 
  chmod 700 /root/checklist_ban
Line 167: Line 167:  
to launch the script, do the following command:
 
to launch the script, do the following command:
 
  /root/checklist_ban
 
  /root/checklist_ban
      
=== Unban an IP ===
 
=== Unban an IP ===

Navigation menu