14,23 → 14,117 |
# echo "$i : ${!i}" >> /tmp/debug-conup.txt |
#done |
ipset del not_auth_yet $FRAMED_IP_ADDRESS |
|
|
# Add user to the SET (function of his filtering level) |
case $FILTER_ID in |
# HAVP |
"00000001") |
set="havp" |
;; |
# HAVP + Blacklist |
"00000011") |
set="havp_bl" |
;; |
# HAVP + Whitelist |
"00000101") |
set="havp_wl" |
;; |
# No filtering |
*) |
set="not_filtered" |
;; |
esac |
|
#12345678 |
#1-> profile1 |
#2-> profile2 |
#3-> profile3 |
#6-> WL |
#7-> BL |
#8-> HAVP |
|
if [ ${FILTER_ID:7:1} -eq '1' ] #HAVP |
then |
set="havp" |
if [ ${FILTER_ID:0:1} -eq '1' ] |
then |
set_proto="proto_1"; |
fi |
|
if [ ${FILTER_ID:1:1} -eq '1' ] |
then |
set_proto="proto_2"; |
fi |
|
if [ ${FILTER_ID:2:1} -eq '1' ] |
then |
set_proto="proto_3"; |
fi |
|
if [ -z "$set_proto" ] |
then |
set_proto="proto_0"; |
fi |
fi |
|
|
if [ ${FILTER_ID:6:1} -eq '1' ] #HAVP_BL |
then |
set="havp_bl" |
if [ ${FILTER_ID:0:1} -eq '1' ] |
then |
set_proto="proto_1"; |
fi |
|
if [ ${FILTER_ID:1:1} -eq '1' ] |
then |
set_proto="proto_2"; |
fi |
|
if [ ${FILTER_ID:2:1} -eq '1' ] |
then |
set_proto="proto_3"; |
fi |
|
if [ -z "$set_proto" ] |
then |
set_proto="proto_0"; |
fi |
fi |
|
if [ ${FILTER_ID:5:1} -eq '1' ] #HAVP_WL |
then |
set="havp_wl" |
if [ ${FILTER_ID:0:1} -eq '1' ] |
then |
set_proto="proto_1"; |
fi |
|
if [ ${FILTER_ID:1:1} -eq '1' ] |
then |
set_proto="proto_2"; |
fi |
|
if [ ${FILTER_ID:2:1} -eq '1' ] |
then |
set_proto="proto_3"; |
fi |
|
if [ -z "$set_proto" ] |
then |
set_proto="proto_0"; |
fi |
fi |
|
|
|
if [ -z "$set" ] #NOT_FILTERED |
then |
set="not_filtered" |
if [ ${FILTER_ID:0:1} -eq '1' ] |
then |
set_proto="proto_1"; |
fi |
|
if [ ${FILTER_ID:1:1} -eq '1' ] |
then |
set_proto="proto_2"; |
fi |
|
if [ ${FILTER_ID:2:1} -eq '1' ] |
then |
set_proto="proto_3"; |
fi |
|
if [ -z "$set_proto" ] |
then |
set_proto="proto_0"; |
fi |
fi |
|
|
ipset add $set $FRAMED_IP_ADDRESS |
ipset add $set_proto $FRAMED_IP_ADDRESS |