(root)//scripts/alcasar-list-ip_gw.sh – Rev 2975
Rev 2973 |
Details |
Compare with Previous |
Last modification |
View Log
| Rev |
Author |
Line No. |
Line |
| 2965 |
rexy |
1 |
#!/bin/sh
|
|
|
2 |
#
|
| 2975 |
rexy |
3 |
# alcasar-list-ip_gw.sh
|
| 2965 |
rexy |
4 |
# by Rexy
|
|
|
5 |
# This script is distributed under the Gnu General Public License (GPL)
|
|
|
6 |
|
| 2975 |
rexy |
7 |
# This script displays authenticated systems (users & @MAC) with their gw
|
| 2965 |
rexy |
8 |
# Ce script affiche les systèmes authentifiés (utilisateurs et @MAC) avec leur routeur
|
|
|
9 |
|
|
|
10 |
CONF_FILE="/usr/local/etc/alcasar.conf"
|
|
|
11 |
|
|
|
12 |
nb_gw=`grep ^WAN $CONF_FILE | wc -l`
|
|
|
13 |
for (( i = 0 ; i <= $nb_gw ; i++ ));do
|
| 2975 |
rexy |
14 |
gw="gw$i"; gw_order=`expr $i + 1`
|
| 2965 |
rexy |
15 |
ip_list=`ipset l $gw|grep -v :`
|
|
|
16 |
for ip in $ip_list;do
|
| 2973 |
rexy |
17 |
echo "$ip $gw_order"
|
| 2965 |
rexy |
18 |
done
|
|
|
19 |
done
|