work on socket. (don't try yet)
[lcr.git] / genrc.c
diff --git a/genrc.c b/genrc.c
index 7b69cca..e42abb2 100644 (file)
--- a/genrc.c
+++ b/genrc.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
 **                                                                           **
-** PBX4Linux                                                                 **
+** LCR                                                                       **
 **                                                                           **
 **---------------------------------------------------------------------------**
 ** Copyright: Andreas Eversberg                                              **
@@ -13,7 +13,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
-#include "save.h"
+#include "macro.h"
 
 char mode[256];
 int type[256];
@@ -51,7 +51,7 @@ int main(void)
        char protocol[1024], layermask[1024], types[256];
 
        printf("\n\nThis program generates a script, which is used to start/stop/restart mISDN\n");
-       printf("driver. All configuration of cards is done for using with the PBX.\n");
+       printf("driver. All configuration of cards is done for using with the LCR.\n");
 
        while(i < (int)sizeof(mode)) /* number of cards */
        {
@@ -67,7 +67,7 @@ int main(void)
                ptp[i] = 0;
                do
                {
-                       printf("\nIs your port #%d connected to point-to-multipoint line/phone, which supports multiple\ntelephones (Mehrgeräteanschluss) OR is it a point-to-point link which is used\nfor PBX and supports extension dialing (Anlagenanschluss)?\n[ptp | ptm]: ", i+1); fflush(stdout);
+                       printf("\nIs your port #%d connected to point-to-multipoint line/phone, which supports multiple\ntelephones (Mehrgeräteanschluss) OR is it a point-to-point link which is used\nfor LCR and supports extension dialing (Anlagenanschluss)?\n[ptp | ptm]: ", i+1); fflush(stdout);
                        scanf("%s", input);
                } while (!!strcmp(input,"ptp") && !!strcmp(input,"ptm"));
                ptp[i] = (input[2]=='p')?1:0;
@@ -152,33 +152,33 @@ int main(void)
 
        n = i;
 
-       printf("\nWhere do you like to load the modules from, enter 0 for default, 1 for\n'/usr/local/pbx/modules/' or the full path.\n[0 | 1 | <path>]: "); fflush(stdout);
+       printf("\nWhere do you like to load the modules from, enter 0 for default, 1 for\n'/usr/local/lcr/modules/' or the full path.\n[0 | 1 | <path>]: "); fflush(stdout);
        scanf("%s", input);
        if (!strcmp(input, "0"))
                SCPY(input, "");
        if (!strcmp(input, "1"))
-               SCPY(input, "/usr/local/pbx/modules");
+               SCPY(input, "/usr/local/lcr/modules");
        if (input[0]) if (input[strlen(input)-1] != '/')
                SCAT(input, "/");
 
-       printf("\n\nFinally tell me where to write the mISDN rc file.\Enter the name 'mISDN' for current directory.\nYou may want to say '/usr/local/pbx/mISDN' or '/etc/rc.d/mISDN'\n: "); fflush(stdout);
+       printf("\n\nFinally tell me where to write the mISDN rc file.\Enter the name 'mISDN' for current directory.\nYou may want to say '/usr/local/lcr/mISDN' or '/etc/rc.d/mISDN'\n: "); fflush(stdout);
        scanf("%s", name);
        if (!(fp=fopen(name, "w")))
        {
                fprintf(stderr, "\nError: Failed to open '%s', try again.\n", name);
-               exit(-1);
+               exit(EXIT_FAILURE);
        }
        fprintf(fp, "# rc script for mISDN driver\n\n");
        fprintf(fp, "case \"$1\" in\n");
        fprintf(fp, "\tstart|--start)\n");
-       fprintf(fp, "\t\t%s %smISDN_core%s debug=0x%x\n", input[0]?"insmod -f":"modprobe", input, input[0]?".ko":"", coredebug);
+       fprintf(fp, "\t\t%s %smISDN_core%s debug=0x%x\n", input[0]?"insmod -f":"modprobe --ignore-install", input, input[0]?".ko":"", coredebug);
        if (anyte)
        {
-               fprintf(fp, "\t\t%s %smISDN_l1%s debug=0x%x\n", input[0]?"insmod -f":"modprobe", input, input[0]?".ko":"", l1debug);
-               fprintf(fp, "\t\t%s %smISDN_l2%s debug=0x%x\n", input[0]?"insmod -f":"modprobe", input, input[0]?".ko":"", l2debug);
-               fprintf(fp, "\t\t%s %sl3udss1%s debug=0x%x\n", input[0]?"insmod -f":"modprobe", input, input[0]?".ko":"", l3debug);
+               fprintf(fp, "\t\t%s %smISDN_l1%s debug=0x%x\n", input[0]?"insmod -f":"modprobe --ignore-install", input, input[0]?".ko":"", l1debug);
+               fprintf(fp, "\t\t%s %smISDN_l2%s debug=0x%x\n", input[0]?"insmod -f":"modprobe --ignore-install", input, input[0]?".ko":"", l2debug);
+               fprintf(fp, "\t\t%s %sl3udss1%s debug=0x%x\n", input[0]?"insmod -f":"modprobe --ignore-install", input, input[0]?".ko":"", l3debug);
        }
-       fprintf(fp, "\t\t%s %smISDN_dsp%s debug=0x%x options=0x%x\n", input[0]?"insmod -f":"modprobe", input, input[0]?".ko":"", dspdebug, lawopt);
+       fprintf(fp, "\t\t%s %smISDN_dsp%s debug=0x%x options=0x%x\n", input[0]?"insmod -f":"modprobe --ignore-install", input, input[0]?".ko":"", dspdebug, lawopt);
        j = 0;
        while(cards[j].card)
        {
@@ -202,9 +202,9 @@ int main(void)
                        if (types[0])
                        {
                                types[strlen(types)-1] = '\0';
-                               fprintf(fp, "\t\t%s %s%s%s type=%s protocol=%s layermask=%s debug=0x%x\n", input[0]?"insmod -f":"modprobe", input, cards[j].module, input[0]?".ko":"", types, protocol, layermask, carddebug);
+                               fprintf(fp, "\t\t%s %s%s%s type=%s protocol=%s layermask=%s debug=0x%x\n", input[0]?"insmod -f":"modprobe --ignore-install", input, cards[j].module, input[0]?".ko":"", types, protocol, layermask, carddebug);
                        } else
-                               fprintf(fp, "\t\t%s %s%s%s protocol=%s layermask=%s debug=0x%x\n", input[0]?"insmod -f":"modprobe", input, cards[j].module, input[0]?".ko":"", protocol, layermask, carddebug);
+                               fprintf(fp, "\t\t%s %s%s%s protocol=%s layermask=%s debug=0x%x\n", input[0]?"insmod -f":"modprobe --ignore-install", input, cards[j].module, input[0]?".ko":"", protocol, layermask, carddebug);
                }
                j++;
        }