From: Art Cancro Date: Tue, 20 Apr 2004 02:32:44 +0000 (+0000) Subject: * Allow setup to run seamlessly from within the Citadel/UX Ridiculously X-Git-Tag: v7.86~5460 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=02965c32449b68c1424e178dea1abaa8ece0d0c6;p=citadel.git * Allow setup to run seamlessly from within the Citadel/UX Ridiculously Easy Installer by observing the values of environment variables CITADEL_INSTALLER, CITADEL, and WEBCIT. --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 69f2ab946..7fdfb112f 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,9 @@ $Log$ +Revision 506.7 2004/04/20 02:32:44 ajc +* Allow setup to run seamlessly from within the Citadel/UX Ridiculously + Easy Installer by observing the values of environment variables + CITADEL_INSTALLER, CITADEL, and WEBCIT. + Revision 506.6 2004/04/20 02:02:50 ajc * "make install" @@ -1776,3 +1781,4 @@ 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 2bb76df2b..5d08633b6 100644 --- a/webcit/setup.c +++ b/webcit/setup.c @@ -37,6 +37,7 @@ int setup_type; char setup_directory[SIZ]; char init_entry[SIZ]; +int using_web_installer = 0; /* @@ -414,20 +415,26 @@ void check_inittab_entry(void) set_value(question, listenport); /* Find out where Citadel is. */ - snprintf(question, sizeof question, - "Is the Citadel service running on the same host as WebCit?"); - if (yesno(question)) { - sprintf(hostname, "uds"); - sprintf(portname, "/usr/local/citadel"); - set_value("In what directory is Citadel installed?", portname); + if ( (using_web_installer) && (getenv("CITADEL") != NULL) ) { + strcpy(hostname, "uds"); + strcpy(portname, getenv("CITADEL")); } else { - sprintf(hostname, "127.0.0.1"); - sprintf(portname, "504"); - set_value("Enter the host name or IP address of your " - "Citadel server.", hostname); - set_value("Enter the port number on which Citadel is " - "running (usually 504)", portname); + snprintf(question, sizeof question, + "Is the Citadel service running on the same host as WebCit?"); + if (yesno(question)) { + sprintf(hostname, "uds"); + sprintf(portname, "/usr/local/citadel"); + set_value("In what directory is Citadel installed?", portname); + } + else { + sprintf(hostname, "127.0.0.1"); + sprintf(portname, "504"); + set_value("Enter the host name or IP address of your " + "Citadel server.", hostname); + set_value("Enter the port number on which Citadel is " + "running (usually 504)", portname); + } } /* Generate a unique entry name for /etc/inittab */ @@ -492,6 +499,11 @@ int main(int argc, char *argv[]) /* set an invalid setup type */ setup_type = (-1); + /* Check to see if we're running the web installer */ + if (getenv("CITADEL_INSTALLER") != NULL) { + using_web_installer = 1; + } + /* parse command line args */ for (a = 0; a < argc; ++a) { if (!strncmp(argv[a], "-u", 2)) { @@ -521,8 +533,13 @@ int main(int argc, char *argv[]) /* Get started in a valid setup directory. */ strcpy(setup_directory, WEBCITDIR); - set_value("In what directory is WebCit installed?", - setup_directory); + if ( (using_web_installer) && (getenv("WEBCIT") != NULL) ) { + strcpy(setup_directory, getenv("WEBCIT")); + } + else { + set_value("In what directory is WebCit installed?", + setup_directory); + } if (chdir(setup_directory) != 0) { important_message("WebCit Setup", "The directory you specified does not exist.");