Advertisement

03.24.2008 at 05:58AM PDT, ID: 23263868
[x]
Attachment Details

check download quota with bash script

Asked by MicheleMarcon in csh / tcsh, Linux Programming, Unix Systems Programming

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 1000Start Free Trial
[+][-]03.24.2008 at 06:15AM PDT, ID: 21193303

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: csh / tcsh, Linux Programming, Unix Systems Programming
Sign Up Now!
Solution Provided By: ravenpl
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628