Make ubuntu recognize a particular event
Hi everyone,
I have an issue whit vnstat. Here's the story:
I use a gprs usb modem to surf the internet, but my isp doesen't want me to do more than ten gigabyte of traffic (download + upload) per month.
So I've installed vnstat.
Then I created a database for the ppp0 interface and all works fine.
The vnstat daemon also works fine and it is always up, nevertheless when I connect the usb modem and start to use the internet, the database remain unapdated and unupdateable until I type sudo vnstat -u (update the database).
Only after the first time that I type "vnstat -u", vnstat starts to update the previously frozen database, but all the bytes I download or upload before that command are not counted.
Since vnstat seems to work, the daemon is on and I don't know where is the problem, I've suggested myself to find a way to make Ubuntu recognize when the ppp0 interface is connected and the automatically launch "vnstat -u" so, magically, the database will be again updateable as soon as I connect the usb modem.
Is there any way to do that without bother crontab?
I hope I was clear.
Thank you.
|