From: Arne Fitzenreiter Date: Sat, 29 May 2010 12:24:47 +0000 (+0200) Subject: Fix ipsectrl I and ipsectrl R terminate vpn-watch. X-Git-Tag: v2.9-beta1~270 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=ba149d470bcc8056f4e55ddeef7aa90eb1f54313 Fix ipsectrl I and ipsectrl R terminate vpn-watch. --- diff --git a/src/misc-progs/ipsecctrl.c b/src/misc-progs/ipsecctrl.c index aa0f41c4d7..16fc86ba3b 100644 --- a/src/misc-progs/ipsecctrl.c +++ b/src/misc-progs/ipsecctrl.c @@ -172,6 +172,17 @@ int main(int argc, char *argv[]) { FILE *file = NULL; + + if (strcmp(argv[1], "I") == 0) { + safe_system("/usr/sbin/ipsec whack --status"); + exit(0); + } + + if (strcmp(argv[1], "R") == 0) { + safe_system("/usr/sbin/ipsec whack --rereadall >/dev/null"); + exit(0); + } + /* Get vpnwatch pid */ if ( (argc == 2) && (file = fopen("/var/run/vpn-watch.pid", "r"))) { @@ -197,16 +208,6 @@ int main(int argc, char *argv[]) { exit(0); } - if (strcmp(argv[1], "R") == 0) { - safe_system("/usr/sbin/ipsec whack --rereadall >/dev/null"); - exit(0); - } - - if (strcmp(argv[1], "I") == 0) { - safe_system("/usr/sbin/ipsec whack --status"); - exit(0); - } - } /* clear iptables vpn rules */