int main(int argc, char *argv[]) { if(argc == 1 || argc == 2 || argc > 3) { usage(); }else if ( (strcmp(argv[1], "--php52") == 0) || (strcmp(argv[1], "--php53") == 0) ){ /* init php versions */ if((strcmp(argv[2], "--start") == 0) || (strcmp(argv[2], "--stop") == 0)){ mnpp(argv[1], argv[2], ""); }else{ usage(); } } else if( (strcmp(argv[1], "--start") == 0) || (strcmp(argv[1], "--stop") == 0) ){ /* init individual services */ if((strcmp(argv[2], "php52") == 0) || (strcmp(argv[2], "php53") == 0) || (strcmp(argv[2], "percona") == 0) || (strcmp(argv[2], "nginx") == 0) || (strcmp(argv[2], "uwsgi") == 0)){ mnpp("", argv[1], argv[2]); }else{ usage(); } } }
int main(int argc, char *argv[]) { if( argc <= 2){ usage(); }else if( ((strcmp(argv[1], "start") == 0) || (strcmp(argv[1], "restart") == 0) || (strcmp(argv[1], "stop") == 0)) \ && ((strcmp(argv[2], "52") == 0) || (strcmp(argv[2], "53") == 0) || (strcmp(argv[2], "54") == 0) )){ mnpp(argv[1], argv[2]); }else if( ((strcmp(argv[1], "nginx") == 0) || (strcmp(argv[1], "percona") == 0))){ manager(argv[1], argv[2], NULL); }else if( (strcmp(argv[1], "php") == 0) && argc == 4 \ && ((strcmp(argv[2], "52") == 0) || (strcmp(argv[2], "53") == 0) || (strcmp(argv[2], "54") == 0) )){ manager(argv[1], argv[2], argv[3]); }else{ usage(); } return 0; }