Subversion Repositories ALCASAR

Rev

Rev 2234 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2234 Rev 2249
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
#
2
#
3
# $Id$
3
# $Id: alcasar-macup.sh 2249 2017-05-22 21:24:55Z tom.houdayer $
4
#
4
#
5
# Le script 'macup' est appelé par coovachilli lorsqu'il attribut une @IP à une @MAC.
5
# Le script 'macup' est appelé par coovachilli lorsqu'il attribut une @IP à une @MAC.
6
# Depuis la version 3.1 de ALCASAR, le système d'interception a changé. On doit traiter les authorisations par adresse MAC en amont
6
# Depuis la version 3.1 de ALCASAR, le système d'interception a changé. On doit traiter les authorisations par adresse MAC en amont
7
# Pour une adresse mac authorisée, nous stockons sont @IP dans l'ipset 'not_filtered'
7
# Pour une adresse mac authorisée, nous stockons sont @IP dans l'ipset 'not_filtered'
8
 
8
 
Line 31... Line 31...
31
	#  3: warn_user (if imputability report has been generated)
31
	#  3: warn_user (if imputability report has been generated)
32
	#  5: WL
32
	#  5: WL
33
	#  6: BL
33
	#  6: BL
34
	#  7: HAVP
34
	#  7: HAVP
35
 
35
 
36
	if [ ${FILTER_ID:7:1} == '1' ]; then	# HAVP
36
	if [ ${FILTER_ID:5:1} == '1' ]; then	# HAVP_WL
37
		set_filter="havp"
37
		set_filter="havp_wl"
38
	elif [ ${FILTER_ID:6:1} == '1' ]; then	# HAVP_BL
38
	elif [ ${FILTER_ID:6:1} == '1' ]; then	# HAVP_BL
39
		set_filter="havp_bl"
39
		set_filter="havp_bl"
40
	elif [ ${FILTER_ID:5:1} == '1' ]; then	# HAVP_WL
40
	elif [ ${FILTER_ID:7:1} == '1' ]; then	# HAVP
41
		set_filter="havp_wl"
41
		set_filter="havp"
42
	else					# NOT_FILTERED
42
	else					# NOT_FILTERED
43
		set_filter="not_filtered"
43
		set_filter="not_filtered"
44
	fi
44
	fi
45
 
45
 
46
	if [ ${FILTER_ID:0:1} == '1' ]; then	# PROFILE 1 (WEB)
46
	if [ ${FILTER_ID:2:1} == '1' ]; then	# PROFILE 3 (Custom)
47
		set_proto="proto_1";
47
		set_proto="proto_3";
48
	elif [ ${FILTER_ID:1:1} == '1' ]; then	# PROFILE 2 (WEB + Mail + Remote access)
48
	elif [ ${FILTER_ID:1:1} == '1' ]; then	# PROFILE 2 (WEB + Mail + Remote access)
49
		set_proto="proto_2";
49
		set_proto="proto_2";
50
	elif [ ${FILTER_ID:2:1} == '1' ]; then	# PROFILE 3 (Custom)
50
	elif [ ${FILTER_ID:0:1} == '1' ]; then	# PROFILE 1 (WEB)
51
		set_proto="proto_3";
51
		set_proto="proto_1";
52
	else					# PROFILE 0 (Not filtered)
52
	else					# PROFILE 0 (Not filtered)
53
		set_proto="proto_0";
53
		set_proto="proto_0";
54
	fi
54
	fi
55
 
55
 
56
	ipset add $set_filter $current_ip
56
	ipset add $set_filter $current_ip