aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sysinstall/tcpip.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2002-05-31 13:39:55 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2002-05-31 13:39:55 +0000
commitdc1024256cc021c17c086fa406121e02f986b4c7 (patch)
treef9e8c56856cf0bc1b70f96d3ffe28b49166eab4a /usr.sbin/sysinstall/tcpip.c
parentdf349781bf4c9f97baaad2288f1104c1110e4885 (diff)
downloadsrc-dc1024256cc021c17c086fa406121e02f986b4c7.tar.gz
src-dc1024256cc021c17c086fa406121e02f986b4c7.zip
If 'netInteractive' is set to true in an installation script, then
temporarily turn off the nonInteractive variable around the DHCP and IPv6 Yes/No questions in a network device setup so that those questions are asked.
Notes
Notes: svn path=/head/; revision=97668
Diffstat (limited to 'usr.sbin/sysinstall/tcpip.c')
-rw-r--r--usr.sbin/sysinstall/tcpip.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c
index 48e62aff3b09..27f353fdb099 100644
--- a/usr.sbin/sysinstall/tcpip.c
+++ b/usr.sbin/sysinstall/tcpip.c
@@ -349,6 +349,18 @@ tcpOpenDialog(Device *devp)
}
else { /* See if there are any defaults */
char *cp;
+ char *old_interactive = NULL;
+
+ /*
+ * This is a hack so that the dialogs below are interactive in a
+ * script if we have requested interactive behavior.
+ */
+ if (variable_get(VAR_NONINTERACTIVE) &&
+ variable_get(VAR_NETINTERACTIVE)) {
+ old_interactive = strdup(VAR_NONINTERACTIVE);
+ variable_unset(VAR_NONINTERACTIVE);
+ }
+
/*
* Try a RTSOL scan if such behavior is desired.
@@ -402,6 +414,12 @@ tcpOpenDialog(Device *devp)
use_dhcp = FALSE;
}
+ /* Restore old VAR_NONINTERACTIVE if needed. */
+ if (old_interactive != NULL) {
+ variable_set2(VAR_NONINTERACTIVE, old_interactive, 0);
+ free(old_interactive);
+ }
+
/* Special hack so it doesn't show up oddly in the tcpip setup menu */
if (!strcmp(gateway, "NO"))
gateway[0] = '\0';