From 6900397965d21fd0f2fab71d4515ea7a6840a805 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 2 Jun 2004 02:07:54 +0000 Subject: [PATCH] * setup.c: updated the setup script to configure two /etc/inittab entries, one for http and one for https. --- webcit/ChangeLog | 5 ++++- webcit/setup.c | 15 ++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 1d780c7ee..e82aa1199 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,8 @@ $Log$ +Revision 510.12 2004/06/02 02:07:54 ajc +* setup.c: updated the setup script to configure two /etc/inittab entries, + one for http and one for https. + Revision 510.11 2004/06/01 21:46:47 ajc * crypto.c: when an SSL connection errors out (and closes) unexpectedly during a read or write operation, do not attempt to finish the operation @@ -1852,4 +1856,3 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix - diff --git a/webcit/setup.c b/webcit/setup.c index 3c7eb7fa1..d37f983e3 100644 --- a/webcit/setup.c +++ b/webcit/setup.c @@ -386,6 +386,7 @@ void check_inittab_entry(void) char looking_for[SIZ]; char question[SIZ]; char entryname[5]; + char entryname2[5]; char http_port[128]; char https_port[128]; char hostname[128]; @@ -448,7 +449,7 @@ void check_inittab_entry(void) } } - /* Generate a unique entry name for /etc/inittab */ + /* Generate unique entry names for /etc/inittab */ snprintf(entryname, sizeof entryname, "c0"); do { ++entryname[1]; @@ -464,6 +465,7 @@ void check_inittab_entry(void) snprintf(buf, sizeof buf, "grep %s: /etc/inittab >/dev/null 2>&1", entryname); } while (system(buf) == 0); + /* Now write it out to /etc/inittab */ infp = fopen("/etc/inittab", "a"); @@ -471,14 +473,13 @@ void check_inittab_entry(void) display_error(strerror(errno)); } else { fprintf(infp, "# Start the WebCit server...\n"); -#ifdef HAVE_OPENSSL - fprintf(infp, "%s:2345:respawn:%s -p%s -s%s %s %s\n", - entryname, looking_for, - http_port, https_port, hostname, portname); -#else - fprintf(infp, "%s:2345:respawn:%s -p%s %s %s\n", + fprintf(infp, "h%s:2345:respawn:%s -p%s %s %s\n", entryname, looking_for, http_port, hostname, portname); +#ifdef HAVE_OPENSSL + fprintf(infp, "s%s:2345:respawn:%s -p%s -s %s %s\n", + entryname, looking_for, + https_port, hostname, portname); #endif fclose(infp); strcpy(init_entry, entryname); -- 2.39.2