1 /*****************************************************************************\
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg **
8 ** installation wizzard **
10 \*****************************************************************************/
16 char *check_mISDN(void)
20 char *install_mISDN(void)
24 char *check_kernel(void)
28 char *install_kernel(void)
32 char *check_includes(void)
36 char *install_includes(void)
40 char *check_device(void)
44 char *install_device(void)
52 char *install_lib(void)
56 char *check_isdnnet(void)
60 char *install_isdnnet(void)
68 char *install_pbx(void)
72 char *check_mISDNrc(void)
76 char *install_mISDNrc(void)
83 (char *(check))(void);
84 (char *(install))(void);
86 { "Install mISDN to kernel Source.", check_mISDN, install_mISDN },
87 { "Compile and install Kernel.", check_kernel, install_kernel },
88 { "Copy user space includes.", check_includes, install_includes },
89 { "Create \"/dev/mISDN\" device", check_device, install_device },
90 { "Compile mISDN device library.", check_lib, install_lib },
91 { "Compile mISDN NT-mode library.", check_isdnnet, install_isdnnet },
92 { "Compile and install PBX4Linux.", check_pbx, install_pbx },
93 { "Create mISDNrc to load mISDN.", check_mISDNrc, install_mISDNrc },
98 int main(int argc, char *argv[])
105 printf("\nWelcome to PBX4Linux installation wizzard.\n\n");
109 /* check what to do */
113 printf("Checking: %s - ", jobs[i].name);
115 ret = jobs[i].check();
128 printf("\nEverything seems to be correctly installed. Do you like to continue? (y/n)");
132 } while(input[0] != 'y' && input[0] != 'n');
138 /* select installation step(s) */
139 printf("\nPlease select one of the following install options:\n");
140 printf("a - Complete installation with all of the following steps\n");
144 printf("%d - Step %d: %s\n", i+1, i+1, jobs[i].name);
147 printf("x - Exit wizzard.\n");
148 printf("\n(a/1-%d/x)", i);
152 } while(input[0]!='a' && (input[0]<'1' || input[0]>('0'+i)) && input[0]!='x');
158 if (input[0]=='a' || (input[0]-'1')==i)
160 printf("\nDoing Step %d: %s\n", i+1, jobs[i].name);
161 ret = jobs[i].check();
163 printf("It is required to continue with this step. Dou you want to continue? (y/n)");
165 printf("It is not required to continue with this step. Still want to continue? (y/n)");
169 } while(input[0] != 'y' && input[0] != 'n');
174 ret = jobs[i].install();
177 printf("Failed to install step: %s\n", jobs[i].name);
179 printf("Do you like to retry? (y/n)");
183 } while(input[0] != 'y' && input[0] != 'n');