summaryrefslogtreecommitdiffstats
path: root/release
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-07-26 10:49:37 +0000
committerbrian <brian@FreeBSD.org>1999-07-26 10:49:37 +0000
commit03ab8a3b7f99d8f1fc922f681d713dde620b53e6 (patch)
tree139b260d39c89fddc544d66db001ad8bb3d2076b /release
parentc8bc216749dc518674b11162d798262506b6b390 (diff)
downloadFreeBSD-src-03ab8a3b7f99d8f1fc922f681d713dde620b53e6.zip
FreeBSD-src-03ab8a3b7f99d8f1fc922f681d713dde620b53e6.tar.gz
Add a default ppp.conf (mode 600).
Originally submitted by: Wayne Self <wself@cdrom.com> Allow a ppp startup option in rc.conf. Adjust sysinstall so that it appends to the end of ppp.conf and uses the generated profile to start ppp in auto mode on boot. Submitted by: Josef L. Karthauser <joe@uk.FreeBSD.org>
Diffstat (limited to 'release')
-rw-r--r--release/sysinstall/network.c14
-rw-r--r--release/sysinstall/sysinstall.h4
2 files changed, 12 insertions, 6 deletions
diff --git a/release/sysinstall/network.c b/release/sysinstall/network.c
index c71f76b..8edf030 100644
--- a/release/sysinstall/network.c
+++ b/release/sysinstall/network.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: network.c,v 1.36 1999/05/19 10:49:43 jkh Exp $
+ * $Id: network.c,v 1.37 1999/07/18 10:18:05 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -246,7 +246,7 @@ startPPP(Device *devp)
close(fd2);
}
if (!Fake)
- fp = fopen("/etc/ppp/ppp.conf", "w");
+ fp = fopen("/etc/ppp/ppp.conf", "a");
else
fp = fopen("/dev/stderr", "w");
if (!fp) {
@@ -268,7 +268,7 @@ startPPP(Device *devp)
dialog_clear_norefresh();
pulse = dialog_yesno("", "Does your telephone line support tone dialing?", -1, -1);
}
- fprintf(fp, "default:\n");
+ fprintf(fp, "\ninstall:\n");
fprintf(fp, " set speed %s\n", speed);
fprintf(fp, " set device %s\n", devp->devname);
fprintf(fp, " set ifaddr %s %s\n", myaddr, provider);
@@ -282,10 +282,14 @@ startPPP(Device *devp)
fprintf(fp, " set authkey %s\n", authkey);
fprintf(fp, " set phone %s\n", phone);
}
- if (fchmod(fileno(fp), 0640) != 0)
+ if (fchmod(fileno(fp), 0600) != 0)
msgConfirm("Warning: Failed to fix permissions on /etc/ppp/ppp.conf !");
fclose(fp);
+ /* Make the ppp config persistent */
+ variable_set2(VAR_PPP_ENABLE, "YES", 0);
+ variable_set2(VAR_PPP_PROFILE, "install", 0);
+
if (!Fake && !file_readable("/dev/tun0") && mknod("/dev/tun0", 0600 | S_IFCHR, makedev(52, 0))) {
msgConfirm("Warning: No /dev/tun0 device. PPP will not work!");
return 0;
@@ -318,7 +322,7 @@ startPPP(Device *devp)
}
else
msgDebug("ppp: Unable to get the terminal attributes!\n");
- execlp("ppp", "ppp", (char *)NULL);
+ execlp("ppp", "ppp", "install", (char *)NULL);
msgDebug("PPP process failed to exec!\n");
exit(1);
}
diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h
index 0ed5308..76d1c00 100644
--- a/release/sysinstall/sysinstall.h
+++ b/release/sysinstall/sysinstall.h
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: sysinstall.h,v 1.170 1999/07/18 10:18:06 jkh Exp $
+ * $Id: sysinstall.h,v 1.171 1999/07/19 10:06:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -148,6 +148,8 @@
#define VAR_PCNFSD "pcnfsd"
#define VAR_PKG_TMPDIR "PKG_TMPDIR"
#define VAR_PORTS_PATH "ports"
+#define VAR_PPP_ENABLE "ppp_enable"
+#define VAR_PPP_PROFILE "ppp_profile"
#define VAR_RELNAME "releaseName"
#define VAR_ROOT_SIZE "rootSize"
#define VAR_ROUTER "router"
OpenPOWER on IntegriCloud