]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/misc-progs/openvpnctrl.c
misc-progs: Kill OpenVPN Authenticator before OpenVPN
[people/pmueller/ipfire-2.x.git] / src / misc-progs / openvpnctrl.c
index 92b5989e9005f73e58947a1c419efb49dd32b317..f5e12adf0bdd1f07268c9caa021865a2bb2b2580 100644 (file)
@@ -469,6 +469,9 @@ static void stopAuthenticator() {
 void stopDaemon(void) {
        char command[STRING_SIZE];
 
+       // Stop OpenVPN authenticator
+       stopAuthenticator();
+
        int pid = readPidFile("/var/run/openvpn.pid");
        if (!pid > 0) {
                exit(1);
@@ -479,9 +482,6 @@ void stopDaemon(void) {
 
        snprintf(command, STRING_SIZE - 1, "/bin/rm -f /var/run/openvpn.pid");
        executeCommand(command);
-
-       // Stop OpenVPN authenticator
-       stopAuthenticator();
 }
 
 static int startAuthenticator(void) {