]> code.citadel.org Git - citadel.git/commitdiff
* setup now has a silent running mode (-q option) where it silently sets
authorMichael Hampton <io_error@uncensored.citadel.org>
Sat, 26 Jan 2002 09:23:40 +0000 (09:23 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Sat, 26 Jan 2002 09:23:40 +0000 (09:23 +0000)
  defaults for everything.  This is intended for use in scripts such as
  the RPM packages, eliminating a step from the installation process.

citadel/ChangeLog
citadel/setup.c

index 3c35fb6f89646287861a034096e43360e8240179..e304e7c61c5e895f38064e48bb7ce730e2812831 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 590.91  2002/01/26 09:23:40  error
+ * setup now has a silent running mode (-q option) where it silently sets
+   defaults for everything.  This is intended for use in scripts such as
+   the RPM packages, eliminating a step from the installation process.
+
  Revision 590.90  2002/01/26 09:19:16  error
  * citadel.spec has been completely overhauled, we can make RPMs now!
 
@@ -3251,4 +3256,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index a9811fb7806a04e0a0018df23be76141bf25b23f..0c8170fb849813e5854fae93a5553fe22a2cb667 100644 (file)
@@ -37,6 +37,7 @@
 #define UI_TEXT                0       /* Default setup type -- text only */
 #define UI_DIALOG      1       /* Use the 'dialog' program (REMOVED) */
 #define UI_CURSES      2       /* Use curses */
+#define UI_SILENT      3       /* Silent running, for use in scripts */
 
 #define SERVICE_NAME   "citadel"
 #define PROTO_NAME     "tcp"
@@ -238,8 +239,10 @@ void hit_any_key(void)
                return;
        }
 #endif
-       printf("Press return to continue...");
-       fgets(junk, 5, stdin);
+       if (setup_type == UI_TEXT) {
+               printf("Press return to continue...");
+               fgets(junk, 5, stdin);
+       }
 }
 
 int yesno(char *question)
@@ -701,6 +704,9 @@ int main(int argc, char *argv[])
                if (!strcmp(argv[a], "-i")) {
                        info_only = 1;
                }
+               if (!strcmp(argv[a], "-q")) {
+                       setup_type = UI_SILENT;
+               }
        }
 
 
@@ -856,8 +862,10 @@ int main(int argc, char *argv[])
 
 
        /* Go through a series of dialogs prompting for config info */
-       for (curr = 1; curr <= MAXSETUP; ++curr) {
-               edit_value(curr);
+       if (setup_type != UI_SILENT) {
+               for (curr = 1; curr <= MAXSETUP; ++curr) {
+                       edit_value(curr);
+               }
        }
 
        /*