Subversion Repositories ALCASAR

Rev

Rev 2973 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

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