I want to stop my internet connection when the bandwidth limit is reached.
Here is my script (which obviously doesn't work).
The script should ask for the limit, then check every second the bandwidth limit with the accounting information, and when the limit is reached, the connection should be closed.
Could you please help me?
echo Set the limit
read $limit
while (true)
$bytes=`accounting --this-month -p --provider-format=rxtx --script=sh`;
if ($bytes>$limit) rcsmpppd stop
sleep 1000
Start Free Trial