OnDisconnect 496 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. LOGIN=$1
  3. IP=$2
  4. CASH=$3
  5. ID=$4
  6. fwcmd="/sbin/ipfw -q"
  7. cur_date=`date \+\%Y.\%m.\%d`
  8. cur_time=`date \+\%H:\%M:\%S`
  9. # DELETE OLD PIPES
  10. ${fwcmd} pipe `expr $ID + 101` delete
  11. ${fwcmd} pipe `expr $ID + 32101` delete
  12. # DELETE FROM SHAPER
  13. ${fwcmd} table 3 delete $IP
  14. ${fwcmd} table 4 delete $IP
  15. ${fwcmd} table 47 add $IP
  16. # DAY/NIGHT switcher
  17. /bin/rm /etc/stargazer/dn/$LOGIN
  18. echo "$cur_date $cur_time DISCONNECT: ID-$ID;LOGIN-$LOGIN;IP-$IP;CASH-$CASH" >> /var/stargazer/allconnect.log