[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ProgSoc] Waking up a computer remotely
On 2 Jun, Paul Mclachlan wrote:
>
> Does anyone know of a beast that can sit on your linux box,
> waiting for the 'RING' message through the modem - and when it
> stops, to execute a command (read: dial in to the isp).
You can use a chatscript. :-) (I think the only useful messages I've
sent to progsoc@nospam.progsoc regard chatscripts. It's odd. I mean, it's not
like I write them all the time.)
> I want to be able to call home, and have my computer dial in to
> the net so I can grab stuff off it, as required. But I don't
> really want to try and leave it connected all day, just on the
> off-chance I'll use it.
Before you start, make sure you don't have one of those classy new
BIOSes which can actually *turn on the computer* when they receive RING
though the serial port. You also need a power supply capable of such
things. My power supply was built in the days where power supplies were
meant to supply power and not waste time chatting to the motherboard,
so I can't do it, unfortunately.
If you can't either, then man chat. You basically want a chatscript that
does the following:
* Sets up the modem
* Listens for a "RING" signal
* Waits for you to hang up the phone
* Dials your ISP
* Connects using PPPd.
* Starts over.
It'd be cleaner to do these things in two separate chatscripts, but
they integrate so well... :-)
The following is untested:
-=- chatscript -=-
'' 'ATZ'
'RING '\d\d\d\d\dATDT <your ISP>'
'ogin' '<your username>'
'ssword' '<your password>'
-=- eof -=-
-=- autodial.sh -=-
#!/bin/sh
while : ; do
/usr/sbin/pppd /dev/modem 57600 defaultroute asyncmap 00000000 \
-detach connect "/usr/sbin/chat -t 0 \
-f /path/to/chatscript"
sleep 1
done
-=- eof -=-
The above waits for a RING signal, sleeps for five seconds (allowing
you to hang up), dials your ISP, and logs you in.
> After the phone call, I was planning on having it dial in for 5
> minutes, or something, then if I haven't logged on, to hangup
> and go back to a wait state. [ local calls are free here, so I
> don't have any problems with the process getting started if
> someone else calls ]. Or maybe it would only do it if the phone
> rang < 3 times, given that the answering machine picks up on 4.
> Or whatever.
Just add a few 'RING' '' pairs after the initialisation. As for the 5
minute timeout, I'm not sure how to do it nicely. I thought of two ways
to do it dodgily but I'm not going to say them :-)
> [It'd be cool to have it work with caller-id. I'm not familiar
> with the technology - can any of those fancy voice-modems
> interface to voice recognition technology?]
I've got no clue about this, but someone mentioned there may be an AT
command to handle it, in which case you can use the REPORT keyword in
chat to write it out to a log file.
--
Nicholas (wzdd@nospam.tig.com.au, wzdd@nospam.lardcave.net)
What I really hate is the way [religious people] influence the media. [...]
How often have you seen something like this on the news?
Reporter: "You've just lost your house and everything you own. How do
you feel."
Victim: "I just thank the LORD everyone made it out okay, especially my
little foofoo."
Meanwhile, in the background you see the firefighter who actually saved
little foofoo being treated for his injuries, with LORD nowhere to be
seen...
- http://www.sonic.net/~jhuger/index.htm
--
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for help.
This list is archived at <http://www.progsoc.uts.edu.au/lists/progsoc/>