29,6 → 29,7 |
TMP_HTML="$DIR/log_nf.html" |
TMP_PDF="$DIR/imputabilities_logs-$(date +%F).pdf" |
PASSWD_FILE="/root/ALCASAR-passwords.txt" |
DB_ROOT_PW=$(grep '^db_root=' $PASSWD_FILE | cut -d'=' -f 2-) |
ARCHIVE_LOCATION="$DIR/imputabilities_logs.zip" |
|
|
81,7 → 82,7 |
|
|
#get log information for each users |
mysql -D radius -u root -p$(cat $PASSWD_FILE | grep "root /" | rev | cut -d' ' -f1 | rev) -e "$QUERY" |
mysql -u root -p"$DB_ROOT_PW" -D radius -e "$QUERY" |
|
#Create HTML document which contains every informations about users |
echo "<!DOCTYPE html>" > $TMP_HTML |
157,7 → 158,7 |
|
#inform users about that by setting the fourth bit of Filter-Id at 1. |
QUERY="SELECT username from radreply INTO OUTFILE '$TMP_USERS' FIELDS TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\n';" |
mysql -D radius -u root -p$(cat $PASSWD_FILE | grep "root /" | rev | cut -d' ' -f1 | rev) -e "$QUERY" |
mysql -u root -p"$DB_ROOT_PW" -D radius -e "$QUERY" |
|
if [ -e $TMP_USERS ] && [ $(cat $TMP_USERS | wc -l) -gt 0 ] |
then |
164,7 → 165,7 |
for user in $(cat $TMP_USERS) |
do |
QUERY="set @CurrentFilter=(SELECT value from radreply where username='$user');set @CurrentFilterLeft=(SELECT LEFT(@CurrentFilter,3));set @CurrentFilterRight=(SELECT RIGHT(@CurrentFilter,4));UPDATE radreply SET value = CONCAT((@CurrentFilterLeft),'1', (@CurrentFilterRight)) WHERE username='$user' ;" |
mysql -D radius -u root -p$(cat $PASSWD_FILE | grep "root /" | rev | cut -d' ' -f1 | rev) -e "$QUERY" |
mysql -u root -p"$DB_ROOT_PW" -D radius -e "$QUERY" |
done |
fi |
rm $TMP_USERS |