]> git.sur5r.net Git - ngadmin/commitdiff
Cli: do not force to be logged in batch mode
authordarkcoven <admin@darkcoven.tk>
Wed, 2 Apr 2014 21:47:39 +0000 (23:47 +0200)
committerdarkcoven <admin@darkcoven.tk>
Wed, 2 Apr 2014 21:47:39 +0000 (23:47 +0200)
cli/src/admin.c

index ffc567f1929e5422e7d10a3b3813830d0cf60496..1144c45d70c55f6d2336461aa05b8804b63ff864 100644 (file)
@@ -326,21 +326,15 @@ int main (int argc, char **argv)
        if (mac != NULL && pre_login(mac, retries) != 0)
                goto end;
        
-       if (batch) {
-               /* in batch mode, we must be logged to continue */
-               if (ngadmin_getCurrentSwitch(nga) == NULL) {
-                       printf("must be logged\n");
-                       goto end;
-               }
-       } else {
 #ifdef HAVE_LIBREADLINE
+       if (!batch) {
                /* initialize readline functions */
                rl_attempted_completion_function = my_completion;
                rl_completion_entry_function = my_generator;
                
                sigsetjmp(jmpbuf, 1);
-#endif
        }
+#endif
        
        main_loop_continue = 1;
        while (main_loop_continue) {