diff options
author | jkh <jkh@FreeBSD.org> | 1999-02-14 05:52:57 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1999-02-14 05:52:57 +0000 |
commit | 8869bfb01e68e9825d37394a8392bf6b073767c0 (patch) | |
tree | 0495a02cfc7a2e38fd60762dff2f6adc1f560655 /usr.sbin/sysinstall | |
parent | 377beeaccbbdba8af026477dfb39b3a35aa39d2c (diff) | |
download | FreeBSD-src-8869bfb01e68e9825d37394a8392bf6b073767c0.zip FreeBSD-src-8869bfb01e68e9825d37394a8392bf6b073767c0.tar.gz |
Preserve existing rc.conf contents.
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r-- | usr.sbin/sysinstall/config.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c index cf92b12..8028bef 100644 --- a/usr.sbin/sysinstall/config.c +++ b/usr.sbin/sysinstall/config.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.120 1999/02/05 22:15:47 jkh Exp $ + * $Id: config.c,v 1.121 1999/02/09 22:18:08 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -377,12 +377,16 @@ configRC_conf(void) { FILE *rcSite; Variable *v; + int write_header; - rcSite = fopen("/etc/rc.conf", "w"); + write_header = !file_readable("/etc/rc.conf"); + rcSite = fopen("/etc/rc.conf", "a"); if (!rcSite) return; - fprintf(rcSite, "# This file now contains just the overrides from /etc/defaults/rc.conf\n"); - fprintf(rcSite, "# please make all changes to this file.\n\n"); + if (write_header) { + fprintf(rcSite, "# This file now contains just the overrides from /etc/defaults/rc.conf\n"); + fprintf(rcSite, "# please make all changes to this file.\n\n"); + } /* Now do variable substitutions */ for (v = VarHead; v; v = v->next) { |