]> git.ipfire.org Git - people/stevee/aiccu.git/commitdiff
allow tunnels
authorNorman Rasmussen <norman@rasmussen.co.za>
Sun, 10 Jan 2010 21:45:55 +0000 (21:45 +0000)
committerStefan Schantl <stefan.schantl@ipfire.org>
Wed, 26 Aug 2015 18:20:44 +0000 (18:20 +0000)
    Allow 'tunnels' mode when there's an already running instance.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
unix-console/main.c

index 1e7b4b4e1b3d01689ed5426dd962308b837db9d2..375b61c647f1714adb25cdb54d0390a002433ad0 100755 (executable)
@@ -50,7 +50,7 @@ int sigrunning(int sig)
        /* Close the file again */
        fclose(f);
 
-       /* If we can HUP it, it still runs */
+       /* If we can signal it, it still runs */
        return (pid > 0 && kill(pid, sig) == 0 ? 1 : 0);
 }
 
@@ -302,20 +302,6 @@ int main(int argc, char *argv[])
                return -1;
        }
 
-#ifndef _WIN32
-       /* start or stop? */
-       if (    mode != A_TEST &&
-               mode != A_AUTOTEST)
-       {
-               /* Already running? */
-               if (sigrunning(mode == A_STOP ? SIGTERM : 0) == 1)
-               {
-                       dolog(LOG_ERR, "Already running instance HUP'ed, exiting\n");
-                       return 0;
-               }
-       }
-#endif
-
        /* Verify required parameters */
        if (!g_aiccu->username || !g_aiccu->password)
        {
@@ -331,6 +317,20 @@ int main(int argc, char *argv[])
                return ret == 0 ? -1 : 0;
        }
 
+#ifndef _WIN32
+       /* start or stop? */
+       if (    mode != A_TEST &&
+               mode != A_AUTOTEST)
+       {
+               /* Already running? */
+               if (sigrunning(mode == A_STOP ? SIGTERM : 0) == 1)
+               {
+                       dolog(LOG_ERR, "Already running instance signaled, exiting\n");
+                       return 0;
+               }
+       }
+#endif
+
        /* Get our tunnel */
        hTunnel = get_tunnel();