Home Page › Forums › Network Management › ZeroShell › Exporting captive portal logs to Excel › Reply To: Exporting captive portal logs to Excel
Try this as Cron job to list all accounts with the name “roomxx”:
pakRad(){
echo “Cost;IP;Last;MAC;NAS;RX;TX;Time;Traffic;start;stop;room” >/tmp/log.csv
cd /Database/var/register/system/acct/entries/
for DIRNAME in `find ./r* -name MAC -printf “%h “`
do
echo ${DIRNAME} | sed -e”s/./(room..)/.*/1/”
# awk ‘FNR==1{f++}{a[f,FNR]=$1}END{for(x=1;x<=FNR;x++){for(y=1;y
awk ‘FNR==1{f++}{a[f,FNR]=$1}END{for(x=1;x<=FNR;x++){for(y=1;y
echo ${DIRNAME} | sed -e”s/./(room..)/.*/1/” >>/tmp/log.csv
done
ftp yourFtpServer.xx<
ftpPassword
put /tmp/log.csv ./log.csv
quit
EOF
rm -f /tmp/log.csv
}
pakRad