Subversion Repositories ALCASAR

Rev

Rev 2006 | Rev 2069 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
1294 richard 1
#!/bin/sh
2
 
2068 richard 3
# alcasar-condown.sh
1294 richard 4
# by Rexy
5
# This script is distributed under the Gnu General Public License (GPL)
6
 
2068 richard 7
# This script is launched after each logout
8
# Ce script est lancé à chaque déconnexion d'usager
1294 richard 9
 
10
# Debug : show all the coova parse variables. There are declared in /src/chilli.c
11
#echo "parse coova variables" > /tmp/debug-conup.txt
12
#for i in LAYER3 DEV NET MASK ADDR USER_NAME NAS_IP_ADDRESS SERVICE_TYPE FRAMED_IP_ADDRESS FILTER_ID STATE CLASS CUI SESSION_TIMEOUT IDLE_TIMEOUT CALLING_STATION_ID CALLED_STATION_ID NAS_ID NAS_PORT_TYPE ACCT_SESSION_ID ACCT_INTERIM_INTERVAL WISPR_LOCATION_ID WISPR_LOCATION_NAME WISPR_BANDWIDTH_MAX_UP WISPR_BANDWIDTH_MAX_DOWN WISPR-SESSION_TERMINATE_TIME CHILLISPOT_MAX_INPUT_OCTETS CHILLISPOT_MAX_OUTPUT_OCTETS CHILLISPOT_MAX_TOTAL_OCTETS INPUT_OCTETS OUTPUT_OCTETS SESSION_TIME IDLE_TIME LOCATION OLD_LOCATION TERMINATE_CAUSE
13
#do
1364 richard 14
#	echo "$i : ${!i}" >> /tmp/debug-condown.txt
1294 richard 15
#done
16
 
1364 richard 17
# Remove user from the SET (function of his filtering level)
18
 
2006 raphael.pi 19
#12345678
20
#1-> profile1
21
#2-> profile2
22
#3-> profile3
23
#6-> WL
24
#7-> BL
25
#8-> HAVP
26
 
27
if [ ${FILTER_ID:7:1} -eq '1' ] #HAVP
28
then 
29
	set="havp"
30
	if [ ${FILTER_ID:0:1} -eq '1' ]
31
	then 
32
		set_proto="proto_1";
33
	fi
34
 
35
	if [ ${FILTER_ID:1:1} -eq '1' ]
36
	then 
37
		set_proto="proto_2";
38
	fi
39
 
40
	if [ ${FILTER_ID:2:1} -eq '1' ]
41
	then 
42
		set_proto="proto_3";
43
	fi
44
 
45
	if [ -z "$set_proto"  ]
46
	then 
47
		set_proto="proto_0";
48
	fi
49
fi
50
 
51
if [ ${FILTER_ID:6:1} -eq '1' ] #HAVP_BL
52
then 
53
	set="havp_bl"
54
	if [ ${FILTER_ID:0:1} -eq '1' ]
55
	then 
56
		set_proto="proto_1";
57
	fi
58
 
59
	if [ ${FILTER_ID:1:1} -eq '1' ]
60
	then 
61
		set_proto="proto_2";
62
	fi
63
 
64
	if [ ${FILTER_ID:2:1} -eq '1' ]
65
	then 
66
		set_proto="proto_3";
67
	fi
68
 
69
	if [ -z "$set_proto"  ]
70
	then 
71
		set_proto="proto_0";
72
	fi
73
fi
74
 
75
if [ ${FILTER_ID:5:1} -eq '1' ] #HAVP_WL
76
then 
77
	set="havp_wl"
78
	if [ ${FILTER_ID:0:1} -eq '1' ]
79
	then 
80
		set_proto="proto_1";
81
	fi
82
 
83
	if [ ${FILTER_ID:1:1} -eq '1' ]
84
	then 
85
		set_proto="proto_2";
86
	fi
87
 
88
	if [ ${FILTER_ID:2:1} -eq '1' ]
89
	then 
90
		set_proto="proto_3";
91
	fi
92
 
93
	if [ -z "$set_proto"  ]
94
	then 
95
		set_proto="proto_0";
96
	fi
97
fi
98
 
99
 
100
 
101
if [ -z "$set"  ] #NOT_FILTERED
102
then 
103
	set="not_filtered"
104
	if [ ${FILTER_ID:0:1} -eq '1' ]
105
	then 
106
		set_proto="proto_1";
107
	fi
108
 
109
	if [ ${FILTER_ID:1:1} -eq '1' ]
110
	then 
111
		set_proto="proto_2";
112
	fi
113
 
114
	if [ ${FILTER_ID:2:1} -eq '1' ]
115
	then 
116
		set_proto="proto_3";
117
	fi
118
 
119
	if [ -z "$set_proto"  ]
120
	then 
121
		set_proto="proto_0";
122
	fi
123
fi
124
 
125
 
1364 richard 126
ipset del $set $FRAMED_IP_ADDRESS
2006 raphael.pi 127
ipset del $set_proto $FRAMED_IP_ADDRESS