Re: GNOME and PPP - suggestions for way forward



I wanted to share with you my pppon and pppoff scripts hoping that it might benefit somebody:

This is my /usr/local/bin/pppon file with executable permissions and /usr/local/bin in my PATH environment variable
 

#!/usr/bin/perl -w

if (! -e "/var/run/ppp0.pid") {
        until (-e "/var/run/ppp0.pid") {
                system ('/usr/sbin/pppd connect  \'/usr/sbin/chat -v -f /etc/ppp/prodigy.chat\'');
                sleep (15);
        }
}
 

Here is my /etc/ppp/prodigy.chat file:
(You have to customize here.  555-1212 is a dummy number.  You may have to put in some extra options depending on you login chat protocols from your ISP.)
"" ATZ
OK ATDT555-1212
CONNECT
Here is /etc/ppp/options file:
(You have to customize here.  user <username> where <username> should be your username.  I think this user thing is optional here and I did not test if it would work without this.  I have a 28.8Kbps modem.)
0.0.0.0:
/dev/ttyS2 115200
lock
crtscts
defaultroute
asyncmap 0
mtu 576
mru 576
user myusername
Assuming you have to do pap authentication for logon, you have to create file: /etc/ppp/pap-secrets something like this:
(Here you have to customize.  You have to replace myusername and mypassword with your ownd username and password for your internet logon.  I also tested by replacing ppp0 with * and it worked.)
# Secrets for authentication using PAP
myusername ppp0 mypassword


Here is my /usr/local/bin/pppoff file:
 

#!/bin/bash

if [ -f /var/run/ppp0.pid ]; then
        /bin/kill -TERM `cat /var/run/ppp0.pid`
fi
 

Here are examples of my file user and group permissions.
(You have to customize your group setting by changing /etc/group.  Then use commands chmod and chgrp appropriately.)
 
-rw-r-----   1  root     group1          90       May     8 01:25      options
-rw-------   1 root     root              137      May  8 13:41         pap-secrets
-rw-r-----   1  root     group1         180      May  8 01:25         prodigy.chat

-rwxr-x---   1 root      group1          86        May 11 19:35       pppoff
-rwxr-x---   1 root      group1         125       May 25 20:42       pppon

I am using this with gnome modem lights applets and it is working great for me.  I would mention the settings of this applet here:
 
Updates per second:            1
Connect command:            pppon
Disconnect command:      pppoff
Show connect time and throughput:  checked
Modem lock file:    /var/lock/LCK..ttyS2
(I had to customize this lock file name above.  Originally it was /var/lock/LCK..modem.  It depends on what you put in /etc/ppp/options file and it was /dev/ttyS2 115200 in my case.)
Verify owner of lock file: checked
Device:    ppp0
I have to now click on the Left Hand ON button on the panel of this applet and it toggles on and off my internet connection.  When on, it turns bright green.  I also see the send/receive activities, the transfer rates, the connection times etc.  I think this is great.

I may be risking some of my own security here.  But it may benefit many more people.  Please if you see something wrong and should have been done differently, or if you have suggestions for improvements please let me know.)

Thx.

Tom Gilbert wrote:

Well, I also run Redhat. Mine's v5.2 partially upgraded to 6.0 (only the
bits I use). I have to shamelessly admit that the redhat control-panel
networking tool setup my ppp connection scripts for me.
It doesn't create a pppon or off script, so I made these myself, the pppon
script just calls "ifup ppp0". That's all you need, although my version
also kicks off fetchmail, plays a tune etc etc.
The pppoff script just kills pppd.
It's nothing highly technical, but it means if I'm just checking mail I
can type pppon in the shell and not load x, gnome, gnome-ppp blah, blah
blah.
You can tell the modem-lights applet which scripts to use, so you could
set it up any way you liked. This is my favorite aspect of it.
Also, it watches the modem, so it can tell if something else initiated the
link, and report stats on it as well.

I like this simple, obvious approach. Its easy, powerful and bug-free.
Just the thing I need. Apps like gnome-ppp are great for ease of use,
especially for non-techies, but for me personally are a trip back into
Windows Hand-Holding land (tm). You're walked through the process, but are
held back from straying off the path with your own tweaks and changes. Not
my cup of tea!

Besides, the main point for me is not to configure two connections to the
same provides using two different programs. If i choose one, it'll be the
more powerful and configurable tool everytime, even if the interface to it
is simple and direct.

Tom Gilbert.

->Ha, I knew someone would remind me of this question
->I am gnew to gnome and am only using it as it was default on RedHat 6.0
->Now I am continuing to use it ( over xfce and other lean/fast desktops) cos it
->has so many nifty features
->that I consider well worth the overhead!!
->:-)
->But this modem lights applet, great i thought cos I want a fast way to connect.
->It calls
->pppon and pppoff which I presume one has to write onesself?
->In fact generally I find no pppconection facility in gnome (at least this version
->which comes with Hedwig)
->like there is with kde (kppp)
->So what should one do?
->And are there any tips on writing these pppon/off scripts?
->Thanks
->Phil
->
->Tom Gilbert wrote:
->
->> Wooahh!
->>
->> Let's not get too carried away here. The way this thread is going, the
->> Modem lights applet is going to get axed! See attached mail at bottom.
->>
->> I love this applet. When I first came across it I was happy to have
->> finally found a ppp-dialer which was what I wanted. Its tiny, minimalist,
->> click-on, clock-off, yet shows the important basic stats - specifically
->> whether I am sending or recieving, and how much...
->>
->> The best thing about it is that it will run my own pppon and pppoff
->> scripts. These scripts can also be called via a command line and have the
->> power to control an Internet connection server as well as a dialup desktop
->> machine. I use these scripts as they are extremely flexible and powerful.
->>
->> I appreciate the ease of use that apps such as Gnome-PPP bring to
->> connecting, but I refuse to maintain 2 sets of dialup scripts, especially
->> when the "easy to use" one lacks a lot of flexibility.
->>
->> Now, if the PPP-dialer applet had the facility/option to run a
->> shell-script or two, instead of using its built-in configurations, and to
->> run in the panel with a tiny footprint and show basic stats.... Then you'd
->> be talking.
->>
->> Cheers guys,
->>
->
->

--
        FAQ: Frequently-Asked Questions at http://www.gnome.org/gnomefaq
         To unsubscribe: mail gnome-list-request@gnome.org with
                       "unsubscribe" as the Subject.

-- 
Bhola De (bnde@prodigy.net)
 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]