View Full Version : Command-line PPP connect?
ArtemisG3
04-10-2002, 01:42 PM
What is the command-line equivilant to clicking Connect/Disconnect in Internet Connect? I need to make a crontab that will disconnect and reconnect PPP at 12AM and 12PM.
Any ideas?
Dr-NiKoN
04-12-2002, 07:36 AM
Don't make it harder than it is.
Just make an applescript for each action, and call them from cron.
nikon
theeggman98
04-12-2002, 04:03 PM
I'm not sure about OSX but in FreeBsd there is a file called ppp.conf in /etc/ppp/ that contains all of you information. To dial my ISP all you have to do is type:
ppp -ddial ispname
E.
ArtemisG3
04-12-2002, 05:40 PM
Ok, I tried an Applescript.
tell application "Internet Connect"
connect
end tell
That is the only way I could figure to connect via Applescript. If I am logged in, cron will run the Applescript at the appointed time, but if I am logged out, nothing happens.
I really need this work whether or not a user is logged in.
ArtemisG3
04-12-2002, 05:47 PM
Originally posted by theeggman98
...in FreeBsd there is a file called ppp.conf in /etc/ppp/ that contains all of you information...
I looked in my etc/ppp/ and there was nothing in there.
theeggman98
04-13-2002, 12:53 PM
I just looked in OSX and there is no ppp command either. I'm not sure what the equivalent would be in OSX.
The only idea I have is that there is pppd . When it starts up I got an error because it was looking for /etc/ppp/options
The options file could be the same as ppp.conf for freebsd. I don't dial out through my mac so I can't test it. For an idea of what that file might need go here.
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ppp-and-slip.html#AEN16703
This link is the setup for freebsd but I am guessing it is probably similar.
Throughout this post I'm basing this on the fact that OSX and Freebsd are similar but I really don't know if I'm pointing you in the right direction.
E.
eboaz
04-25-2002, 02:02 PM
Originally posted by ArtemisG3
Ok, I tried an Applescript.
tell application "Internet Connect"
connect
end tell
That is the only way I could figure to connect via Applescript. If I am logged in, cron will run the Applescript at the appointed time, but if I am logged out, nothing happens.
I really need this work whether or not a user is logged in.
Applescript may require that have have someone logged into the computer. You could try enabling 'Connect automatically when starting TCP/IP applications' in the PPP options on the PPP tab of your network system preferences and then use a cron job to ping some internet site (e.g. ping <ip of www.cnn.com>) ... this may work.
[Note: I have not tested this suggestion. YMMV.]
ArtemisG3
04-25-2002, 02:15 PM
That is currently similar to how I keep my connection alive (wget a web address), but my connection times out after exactly 12 hours.
The problem with "connect automatically" is that the computer still thinks it is connected even after the connection drops. If I open Internet Connect, the connection time keeps counting away on the dead connection. It will never re-connect if it thinks it is still connected. :(
macubergeek
04-25-2002, 03:20 PM
pppd is a daemon not a client software
scoping out the man page for pppd I find that yes pppd needs an options file /etc/ppp/options but reading the comments in the man page next to the connect option:
connect script
Use the executable or shell command specified by
script to set up the serial line. This script
would typically use the chat(8) program to dial the
modem and start the remote ppp session. A value
for this option from a privileged source cannot be
overridden by a non-privileged user.
so I'm guessing that pppd needs chat to actually dial the modem. Chat isn't installed in macos x.
I checked fink and there's no package for it there. So I'm guessing that you can't dial the modem via shell but I may be wrong.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.