diff options
author | jhb <jhb@FreeBSD.org> | 2002-05-31 13:39:55 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2002-05-31 13:39:55 +0000 |
commit | 7bc059de3ec1804876e2c07e586291159b861c5d (patch) | |
tree | f9e8c56856cf0bc1b70f96d3ffe28b49166eab4a /usr.sbin | |
parent | 5dfcc5315d8548e548f9ef4a7cfd59c7af13cdc8 (diff) | |
download | FreeBSD-src-7bc059de3ec1804876e2c07e586291159b861c5d.zip FreeBSD-src-7bc059de3ec1804876e2c07e586291159b861c5d.tar.gz |
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.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sysinstall/tcpip.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index 48e62af..27f353f 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'; |