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.
This commit is contained in:
John Baldwin 2002-05-31 13:39:55 +00:00
parent df349781bf
commit dc1024256c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97668

View File

@ -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';