site Search:


 
    All Forums Hot Topics Gallery






how-to block ads


 
Search Topic:
Uniqs:
962
Share Topic
Posting?
Post a:
Post a:
Links: ·TekSavvy DSL Reviews ·TekSavvy Forum FAQ ·Speedtest results
AuthorAll Replies

phoeniXfury

join:2010-05-12
Mississauga, ON

[Cable] Automatically check cable availability on Linux/Mac

Just added to my blog...thought I'd add it here too:

»blog.krystalmods.com/index.php/2···ty-check

#!/bin/bash
 
if [[ $1 == *teksavvy.com* ]] && [[ $2 != "" ]] && [[ $3 == *@* ]]
then
        URL=$1
        POSTALCODE=$2
        EMAIL=$3
else
        echo "Syntax: ./teksavvy_cable_avail.sh <URL> <POSTAL_CODE> <EMAIL>"
        exit 1
fi
 
OUTPUT=`wget -qO- $URL --post-data="postal=$POSTALCODE&submit=Submit" |grep Congratulations`
if [[ $OUTPUT == *"is available"* ]]
then
        echo $OUTPUT |mailx -s "Teksavvy Cable Internet Is Here!" $EMAIL
fi
 

So then I'd add the following in my crontab to check at 8 am everyday:

0 8 * * * /home/ewu/teksavvy_cable_avail.sh http://teksavvy.com/en/checkontariocable.asp <postal_code> <me@myemail.com>
 

Once it is available, I'll get an email. Remember your system has to have working outgoing mail transport.

I hope no one becomes a fanatic and tries to run this every minute or more often. lol


mlerner
Premium
join:2000-11-25
Nepean, ON
kudos:5

Thanks for sharing your script. I should start doing this on my Mac since I'm still eagerly waiting for the Ottawa launch.

1 minute? Nah 30 seconds is more like it.



pat2008
I'm Incognito
Premium
join:2008-11-19
Mississauga, ON

Why oh why is the TSI website down? .... Rocky: You damn people running that stupid script every 30 seconds.

lol... i've been meaning to make something but every time i think about it i get distracted elsewhere, so thanks.


pablo
MVM
join:2003-06-23
kudos:1

reply to mlerner

said by mlerner:

1 minute? Nah 30 seconds is more like it.
`cron's resolution is one minute.

Of course you could put the script in a loop: are we there yet? are we there yet?

Cheers,
-pablo
--
openSUSE 11.1/KDE
ISP: TekSavvy DSL; backhauled via a 6KM wireless link

Monday, 04-Jun 00:47:42 Terms of Use & Privacy | feedback | contact | Hosting by nac.net - DSL,Hosting & Co-lo
over 12.5 years online © 1999-2012 dslreports.com.
Most commented news this week
Hot Topics