Accel-ppp session termination script

I will give an example of a script to end the sessions taken on the official telegram channel Accel-ppp. Using accel-cmd and grep, we select the necessary sessions, for example, by the speed of the shaper, or part of the IP address, for example 10.10.10. and then for example send these sessions terminate if ipoeX soft or hard via accel-cmd.

The contents of the script:

filetmp=/tmp/4096.txt
rm $filetmp

accel-cmd -P pass -H192.168.5.5 show sessions | grep 102400 | while read line ; do

echo $line >> $filetmp
done;

less $filetmp | while read line ; do
interf=$(echo $line | awk -F " " '{print $1}');
#    echo $interf
if (( $interf > "0" ))
    echo $interf
then

    accel-cmd -P pass -H192.168.5.5 terminate if $interf soft && echo $interf" - Terminate" || echo "ERROR"
#    exit
fi

done;

Before each script execution, make sure that only the necessary sessions are selected through grep:

accel-cmd -P pass -H192.168.5.5 show sessions | grep 102400
accel-cmd -P pass -H192.168.5.5 show sessions | grep 10.10.10.
accel-cmd -P pass -H192.168.5.5 show sessions

After executing the script, make sure that the necessary sessions have switched from the active state to finish.

See also my article:
Accel-ppp and ABillS session synchronization script

Leave a comment

Leave a Reply

Discover more from IT Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading