Auto invoke browser upon wvdial successful Internet connection
Barry Yu
barryyupuilee at sbcglobal.net
Mon May 3 18:52:21 UTC 2004
Keven Ring wrote:
> Bob Shaffer wrote:
>
>> This will do what you want.
>>
>> #!/bin/bash
>>
>> nohup wvdial 1>/dev/null 2>/dev/null &
>>
>> while true; do
>> if [ -n "`/sbin/pidof pppd`" ]; then
>> # successfully connected
>> mozilla &
>> exit
>> fi
>> if [ -z "`/sbin/pidof wvdial`" ]; then
>> # wvdial failed and exited
>> xmessage "Failed to connect."
>> exit
>> fi
>> sleep 1
>> done
>>
>> # end of script
>>
>> It doesn't represent my life's work or anything, but it will work.
>> You can just run "killall -2 wvdial" to close the connection.
>>
>>
>
> Argh! Using a sledge hammer to drive a 6 penny nail....
>
> Sure, you *can* do that. However, since the docs on pppd indicate
> that it will invoke the script /etc/ppp/ip-up when a connection has
> been established, and furthermore, the /etc/ppp/ip-up script [at
> least, as distributed by Fedora] looks for [and then invokes]
> /etc/ppp/ip-up.local, you could do exactly what you suggested with the
> following:
>
> #!/bin/sh
> mozilla &
>
> This uses the systems built-in notification mechanism, rather than
> writing custom scripts which may or may not take into account various
> failure options. As far as "killing" your wvidal process, how about
> "ifdown ppp0" instead? Alternatively, you could use the "modem
> lights" applet to your panel, and connect or disconnect from a GUI.
>
>> You can actually set up pppd to dial for you, and dial on demand if you
>> want too. That way when you open a browser it will automatically
>> dial for
>> you if you're offline.
>>
>>
> While interesting, this would kind-of defeat the purpose of using
> wvdial, wouldn't it? It also doesn't seem to be very effective in
> dynamic situations [such as typical dial-up, where you obtain a
> different IP every time you connect], but I could be wrong....
>
Many thanks for another alternative to invoke the browser, but if you
don't mind, please be a little more specifig how to use the "modem
lights" applet to panel, and connect or disconnect from a GUI, sounds
like that is the way kppp is using, but would like to use this on
wvdial, I want to do this is just for further explore the variation of
using wvdial - and I like wvdial.
More information about the fedora-list
mailing list