summaryrefslogtreecommitdiff
path: root/usr.sbin/sysinstall/variable.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1998-07-18 09:42:02 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1998-07-18 09:42:02 +0000
commit8eac04a7929b8750739431de9695fe8cf55e8027 (patch)
tree58ea4d5a7114126d5b075aab4ddb9f2dd9951c9e /usr.sbin/sysinstall/variable.c
parente5d7d243615d5a196a46d23a162623d438454de1 (diff)
Notes
Diffstat (limited to 'usr.sbin/sysinstall/variable.c')
-rw-r--r--usr.sbin/sysinstall/variable.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/usr.sbin/sysinstall/variable.c b/usr.sbin/sysinstall/variable.c
index 610fb3de3187..2dc227af619b 100644
--- a/usr.sbin/sysinstall/variable.c
+++ b/usr.sbin/sysinstall/variable.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: variable.c,v 1.22 1998/03/10 17:24:08 jkh Exp $
+ * $Id: variable.c,v 1.23 1998/03/15 17:10:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -198,3 +198,27 @@ variable_check(char *data)
else
return getenv(tmp) ? TRUE : FALSE;
}
+
+int
+dump_variables(dialogMenuItem *unused)
+{
+ FILE *fp;
+ Variable *vp;
+
+ if (isDebug())
+ msgDebug("Writing sysinstall variables to file..");
+
+ fp = fopen("/etc/sysinstall.vars", "w");
+ if (!fp) {
+ msgConfirm("Unable to write to /etc/sysinstall.vars: %s",
+ strerror(errno));
+ return DITEM_FAILURE;
+ }
+
+ for (vp = VarHead; vp; vp = vp->next)
+ fprintf(fp, "%s=\"%s\"\n", vp->name, vp->value);
+
+ fclose(fp);
+
+ return DITEM_SUCCESS;
+}