From dc1024256cc021c17c086fa406121e02f986b4c7 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 31 May 2002 13:39:55 +0000 Subject: [PATCH] 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. --- usr.sbin/sysinstall/tcpip.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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';