diff options
author | jkh <jkh@FreeBSD.org> | 1996-12-22 17:29:33 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-12-22 17:29:33 +0000 |
commit | 52623b565c8fc4ba063611c16810780149f5a572 (patch) | |
tree | 72cd3867b0a34f1c1c5b4b27757dd905d1a8e4e0 /usr.sbin/ppp/command.c | |
parent | 6ca14a89c608ae04e77c840dbd24a9587eb1e5c7 (diff) | |
download | FreeBSD-src-52623b565c8fc4ba063611c16810780149f5a572.zip FreeBSD-src-52623b565c8fc4ba063611c16810780149f5a572.tar.gz |
For /usr/sbin/ppp, you must choose between running ppp in the background or
connecting to a host immediately in the foreground.
I would like to be able to run ppp from a script so that my script can be
sure that it is connected to the 'net before it continues running:
# Dial up the internet.
ppp -background myprovider || exit 1
do-some-net-command
# Hang up the modem.
kill -HUP `cat /var/run/ppp.tun0.pid`
Another problem is that the current ppp calls its process id file
`/var/run/PPP.server', which may conflict if you have more than one IP
tunnel interface available.
Closes PR#1469
Submitted by: Gord Matzigkeit <gord@enci.ucalgary.ca>
Diffstat (limited to 'usr.sbin/ppp/command.c')
-rw-r--r-- | usr.sbin/ppp/command.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index bf40cb3..ad875c8 100644 --- a/usr.sbin/ppp/command.c +++ b/usr.sbin/ppp/command.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: command.c,v 1.25 1996/12/03 21:38:39 nate Exp $ + * $Id: command.c,v 1.26 1996/12/22 17:09:12 jkh Exp $ * */ #include <sys/types.h> @@ -164,7 +164,7 @@ char **argv; { const char *shell; pid_t shpid; - + if((shell = getenv("SHELL")) == 0) { shell = _PATH_BSHELL; } @@ -222,7 +222,7 @@ char **argv; } else execl(shell, shell, NULL); - + fprintf(stdout, "exec() of %s failed\n", argc > 0? argv[0]: shell); exit(255); } @@ -232,9 +232,9 @@ char **argv; int status; (void)waitpid(shpid, &status, 0); } - + TtyCommandMode(1); - + return(0); } @@ -822,7 +822,7 @@ char **argv; if (--argc > 0) { ParseAddr(argc, argv++, &DefTriggerAddress.ipaddr, - &DefTriggerAddress.mask, + &DefTriggerAddress.mask, &DefTriggerAddress.width); } } @@ -981,7 +981,6 @@ char **argv; } return(1); } - static char StrChatStr[] = "chat-script"; static char StrValue[] = "value"; |