Code: ## Wireless Conn Notice wlnote='/tmp/wlnote.sh' ( cat <<'ENDFILE' #!/bin/sh xfer=0 pxfer=0 if wl assoclist | grep -v <mac here> ; then xfer=$(ifconfig eth1|grep bytes|cut -d":" -f2|cut -d" " -f1) sleep 30 pxfer=$(ifconfig eth1|grep bytes|cut -d":" -f2|cut -d" " -f1) fi if [ "$xfer" -ge 1 ] && [ "$pxfer" -gt 1 ] && [ "$xfer" -ne "$pxfer" ] ; then led amber on if [ `grep -c Amber /var/log/messages` -lt 15 ] ; then logger 'Wireless activity detected Amber light ON' fi else led amber off fi ## Limit Log message ## if [ `grep -c Wlnotify /var/log/messages` -lt 15 ] ; then logger 'Wlnotify script executed' fi ENDFILE ) > $wlnote if [ -f "$wlnote" ] ; then chmod 777 $wlnote logger $wlnote created else logger Problem creating $wlnote fi cru a wnotify "*/1 * * * * $wlnote" Edit: Corrected script after I found out how to get it working.... this should now work. Variable expansion has to be turned off !
Its supposed to turn Amber led on when there is wireless activity other than my wireless network printer. Plus limit log messages. It does not do either of these things.
I posted it on devshed forum also... maybe someone there can help too http://forums.devshed.com/linux-help-33/why-won-t-this-script-work-473805.html
I finally got this bastard working !! See last post on devshed forum for the reason why it was not working.
I'd like a script for Tomato to mail me on a gmail when a broken connection is up again. So: when a PPPoE connection is restablished, mail to me. :biggrin:
I really wish there was some sendmail equivalent in tomato... Maybe that will make it into 1.11. I haven't figured out any way to send any e-mail via Tomato. - Mike
I'd ldeally perfer a solution which can send mail from a stock Tomato firmware... I.e. No special compiles, or installs... I would have no idea where to start with masqmail.
I'm not sure it fits with the fast/slim philosophy to have sendmail built in BUT because Tomato is so slim everyone can have some size of jffs partition (not sure about loading apps from cifs). We could have a library of standalone binaries that for scripts - I wouldn't have though mail would need specific kernel support? NB any utility needs to built with the correct toolchain against the same kernel...
mini-sendmail is even smaller (5-10K) and it got an IPK which can used to wget it from the web and unpack it to /tmp directory so in a way you could get that functionality in a script...