Ok so I have made some progess.
I have managed to write a pretty basic script that checks to see whether there is a PPPOE connection active:
Code:
#!/bin/bash
result=`ifconfig ppp`
NOW=$(date)
if [ -z "$result" ]
then
pkill transmission
echo "PPPOE Down, sending kill signal to Transmission Client"
echo $NOW + ": failed;" > /var/log/dsl
#send notification mail
else
echo "PPPOE is UP"
echo $NOW + ": up;" >> /var/log/dsl
fi
The script works exactly as I want it to when I run it in Terminal, however it fails when run using cron.
I added the task to cron using gnome's scheduled tasks.
I came across someone else had an issue with scripts running in cron, and there solution was to remove the password for their keypair, which I have no idea how to do, or what the implications of this are.
Would appreciate any other ideas!!
Bookmarks