1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-04 09:09:56 +00:00

Preserve existing rc.conf contents.

This commit is contained in:
Jordan K. Hubbard 1999-02-14 05:52:57 +00:00
parent 1fc1a0dc40
commit 37e9b7b068
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43982
3 changed files with 24 additions and 12 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {