Code: Select all
#!/bin/sh
date
netstat -ie | grep -A6 "$1" | grep "packets"
Code: Select all
>saveinetdata ppp0 >>inetdataused.txt
Code: Select all
#!/bin/sh
date
netstat -ie | grep -A6 "$1" | grep "packets"
Code: Select all
>saveinetdata ppp0 >>inetdataused.txt
Code: Select all
/var/local/pupdial/isp1/
May depend on the way you close your connection, but at least when you use the tray icon and choose "Disconnect from network" this should work:puppy_apprentice wrote:It will be better to save usage statistics for all connections scripts
Code: Select all
actif=`route | grep "default" | awk '{ print $8 '}` #determine active interface
date >> /root/$actif-log.txt
netstat -ie | grep -A6 $actif | grep "packets" >> /root/$actif-log.txt
Code: Select all
#!/bin/sh
actif=`route | grep "default" | awk '{ print $8 '}` #determine active interface
date >> /root/$actif-log.txt
ifconfig $actif | grep "bytes" >> /root/$actif-log.txt
Code: Select all
network
|-- if-down.d
| `-- script
|-- if-post-down.d
| `-- script
|-- if-pre-down.d
| `-- script
`-- interfaces
Code: Select all
#!/bin/sh
# filename: saveinetdata
if [ "$IFACE" = "ppp0" ]; then
saveinetdata
fi
Code: Select all
iface ppp0 inet wvdial
Code: Select all
ifup ppp0 #to configure interface
Code: Select all
ifdown ppp0 #to run script
Code: Select all
--disconnect) #disconnect using default tool.
saveinetdata #or ifdown ppp0
case $CURREXEC in