]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/main.c
check if we have ppp early on
[ppp.git] / pppd / main.c
index 638e296ba3e13702d0549f366c963cc1c0a042a6..30596d160b47b8773700143f2c5d19670d32a20e 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: main.c,v 1.1 1993/11/11 03:54:25 paulus Exp $";
+static char rcsid[] = "$Id: main.c,v 1.3 1993/12/14 05:16:01 paulus Exp $";
 #endif
 
 #define SETSID
@@ -31,6 +31,14 @@ static char rcsid[] = "$Id: main.c,v 1.1 1993/11/11 03:54:25 paulus Exp $";
 #include <netdb.h>
 #include <utmp.h>
 
+/*
+ * If REQ_SYSOPTIONS is defined to 1, pppd will not run unless
+ * /etc/ppp/options exists.
+ */
+#ifndef        REQ_SYSOPTIONS
+#define REQ_SYSOPTIONS 0
+#endif
+
 #ifdef STREAMS
 #undef SGTTY
 #endif
@@ -215,6 +223,11 @@ main(argc, argv)
 
     pid = getpid();
 
+    if (!ppp_available()) {
+       fprintf(stderr, "Sorry - PPP is not available on this system\n");
+       exit(1);
+    }
+
     /*
      * Initialize to the standard option set, then parse, in order,
      * the system options file, the user's options file, and the command
@@ -225,7 +238,7 @@ main(argc, argv)
   
     progname = *argv;
 
-    if (!options_from_file(_PATH_SYSOPTIONS) ||
+    if (!options_from_file(_PATH_SYSOPTIONS, REQ_SYSOPTIONS) ||
        !options_from_user() ||
        !parse_args(argc-1, argv+1))
        die(1);