(root)/scripts/alcasar-flush_ipset_wl.sh – Rev 1905
Rev 1906 |
Go to most recent revision |
Details |
Last modification |
View Log
Rev |
Author |
Line No. |
Line |
1905 |
raphael.pi |
1 |
#!/bin/sh
|
|
|
2 |
#by Raphaël Pion
|
|
|
3 |
#Permet de vider l'ipset wl_ip_allowed lorsque tous les utilisateurs de la whitelist sont déconnectés
|
|
|
4 |
#Clean wl_ip_allowed ipset when WL users are gone.
|
|
|
5 |
|
|
|
6 |
PTN="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
|
|
|
7 |
NB_USERS=ipset list havp_wl | grep -E $PTN | wc -l
|
|
|
8 |
if [ $NB_USER -eq '0' ]
|
|
|
9 |
then
|
|
|
10 |
ipset flush wl_ip_allowed
|
|
|
11 |
fi
|