| Line 1... |
Line 1... |
| 1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
| 2 |
#
|
2 |
#
|
| 3 |
# $Id: alcasar-condown.sh 2712 2019-03-10 23:28:36Z tom.houdayer $
|
3 |
# $Id: alcasar-condown.sh 2841 2020-06-28 21:49:00Z rexy $
|
| 4 |
#
|
4 |
#
|
| 5 |
# alcasar-condown.sh
|
5 |
# alcasar-condown.sh
|
| 6 |
# by Rexy
|
6 |
# by Rexy
|
| 7 |
# This script is distributed under the Gnu General Public License (GPL)
|
7 |
# This script is distributed under the Gnu General Public License (GPL)
|
| 8 |
|
8 |
|
| Line 27... |
Line 27... |
| 27 |
db_res=$(mysql -u root -p$(cat $PASSWD_FILE | grep ^db_root= | cut -d'=' -f2-) -D radius -e "$db_query" -Ns)
|
27 |
db_res=$(mysql -u root -p$(cat $PASSWD_FILE | grep ^db_root= | cut -d'=' -f2-) -D radius -e "$db_query" -Ns)
|
| 28 |
|
28 |
|
| 29 |
filter=$(echo "$db_res" | awk '$1 == "Alcasar-Filter" { print $2 }')
|
29 |
filter=$(echo "$db_res" | awk '$1 == "Alcasar-Filter" { print $2 }')
|
| 30 |
filterProto=$(echo "$db_res" | awk '$1 == "Alcasar-Protocols-Filter" { print $2 }')
|
30 |
filterProto=$(echo "$db_res" | awk '$1 == "Alcasar-Protocols-Filter" { print $2 }')
|
| 31 |
|
31 |
|
| 32 |
if [ "$filter" == '4' ]; then # HAVP_WL
|
32 |
if [ "$filter" == '4' ]; then # AV_WL
|
| 33 |
set_filter="havp_wl"
|
33 |
set_filter="av_wl"
|
| 34 |
elif [ "$filter" == '3' ]; then # HAVP_BL
|
34 |
elif [ "$filter" == '3' ]; then # AV_BL
|
| 35 |
set_filter="havp_bl"
|
35 |
set_filter="av_bl"
|
| 36 |
elif [ "$filter" == '2' ]; then # HAVP
|
36 |
elif [ "$filter" == '2' ]; then # AV
|
| 37 |
set_filter="havp"
|
37 |
set_filter="av"
|
| 38 |
else # NOT_FILTERED
|
38 |
else # NOT_FILTERED
|
| 39 |
set_filter="not_filtered"
|
39 |
set_filter="not_filtered"
|
| 40 |
fi
|
40 |
fi
|
| 41 |
|
41 |
|
| 42 |
if [ "$filterProto" == '4' ]; then # PROFILE 3 (Custom)
|
42 |
if [ "$filterProto" == '4' ]; then # PROFILE 3 (Custom)
|
| Line 51... |
Line 51... |
| 51 |
|
51 |
|
| 52 |
ipset del $set_filter $FRAMED_IP_ADDRESS
|
52 |
ipset del $set_filter $FRAMED_IP_ADDRESS
|
| 53 |
ipset del $set_filterProto $FRAMED_IP_ADDRESS
|
53 |
ipset del $set_filterProto $FRAMED_IP_ADDRESS
|
| 54 |
|
54 |
|
| 55 |
# Remove IP address from active users
|
55 |
# Remove IP address from active users
|
| 56 |
current_users_file="/var/tmp/havp/current_users.txt"
|
56 |
current_users_file="/tmp/current_users.txt"
|
| 57 |
[ -e $current_users_file ] && sed -i "/^$FRAMED_IP_ADDRESS:/d" $current_users_file
|
57 |
[ -e $current_users_file ] && sed -i "/^$FRAMED_IP_ADDRESS:/d" $current_users_file
|
| 58 |
|
58 |
|
| 59 |
# Debug : show all the coova parse variables (+ $set_filter + $set_filterProto).
|
59 |
# Debug : show all the coova parse variables (+ $set_filter + $set_filterProto).
|
| 60 |
# see "/src/chilli.c" for the complete list of parse variables
|
60 |
# see "/src/chilli.c" for the complete list of parse variables
|
| 61 |
#echo "-----------------------------------------------" >> /tmp/debug-condown.txt
|
61 |
#echo "-----------------------------------------------" >> /tmp/debug-condown.txt
|