diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c index 40892ba1c0e..2b682d98601 100644 --- a/source3/utils/smbcontrol.c +++ b/source3/utils/smbcontrol.c @@ -46,7 +46,7 @@ static void usage(BOOL doexit) { int i; if (doexit) { - printf("Usage: smbcontrol -i\n"); + printf("Usage: smbcontrol -i -s configfile\n"); printf(" smbcontrol \n\n"); } else { printf(" \n\n"); @@ -380,23 +380,26 @@ static BOOL do_command(char *dest, char *msg_name, char **params) TimeInit(); setup_logging(argv[0],True); - lp_load(servicesf,False,False,False); - - if (!message_init()) exit(1); - if (argc < 2) usage(True); - while ((opt = getopt(argc, argv,"i")) != EOF) { + while ((opt = getopt(argc, argv,"is:")) != EOF) { switch (opt) { case 'i': interactive = True; break; + case 's': + pstrcpy(servicesf, optarg); + break; default: printf("Unknown option %c (%d)\n", (char)opt, opt); usage(True); } } + lp_load(servicesf,False,False,False); + + if (!message_init()) exit(1); + argc -= optind; argv = &argv[optind];