(root)/scripts/alcasar-flush_ipset_wl.sh @ 2572 – Rev 2841
Rev 1907 |
Details |
Compare with Previous |
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]?)"
|
2841 |
rexy |
7 |
NB_USERS=$(ipset list av_wl | grep -E $PTN | wc -l)
|
1906 |
raphael.pi |
8 |
if [ $NB_USERS -eq '0' ]
|
1905 |
raphael.pi |
9 |
then
|
1907 |
raphael.pi |
10 |
/sbin/ipset flush wl_ip_allowed
|
1905 |
raphael.pi |
11 |
fi
|