summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade/variable.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1998-07-18 09:42:02 +0000
committerjkh <jkh@FreeBSD.org>1998-07-18 09:42:02 +0000
commitc1d10d181de9930858213c26964bf148cbe069b5 (patch)
treebfa3f95ddcd21759181a743fd429f5a33e0d0ad1 /usr.sbin/sade/variable.c
parent7466f92c1a75cdfc614e9b0f5eccf1f8afb31d06 (diff)
downloadFreeBSD-src-c1d10d181de9930858213c26964bf148cbe069b5.zip
FreeBSD-src-c1d10d181de9930858213c26964bf148cbe069b5.tar.gz
MF22: Paul Traina's changes.
Diffstat (limited to 'usr.sbin/sade/variable.c')
-rw-r--r--usr.sbin/sade/variable.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/usr.sbin/sade/variable.c b/usr.sbin/sade/variable.c
index 610fb3d..2dc227a 100644
--- a/usr.sbin/sade/variable.c
+++ b/usr.sbin/sade/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;
+}
OpenPOWER on IntegriCloud