Change ipsec up/down of a tunnel.

This commit is contained in:
Arne Fitzenreiter
2010-05-08 15:35:11 +02:00
parent 142eea7a3b
commit 98065e83ed

View File

@@ -138,11 +138,7 @@ int decode_line (char *s,
void turn_connection_on (char *name, char *type) {
char command[STRING_SIZE];
safe_system("/usr/sbin/ipsec whack --rereadall >/dev/null");
memset(command, 0, STRING_SIZE);
snprintf(command, STRING_SIZE - 1,
"/usr/sbin/ipsec down %s >/dev/null", name);
safe_system(command);
safe_system("/usr/sbin/ipsec reload >/dev/null");
memset(command, 0, STRING_SIZE);
snprintf(command, STRING_SIZE - 1,
"/usr/sbin/ipsec up %s >/dev/null", name);
@@ -155,8 +151,9 @@ void turn_connection_off (char *name) {
char command[STRING_SIZE];
memset(command, 0, STRING_SIZE);
snprintf(command, STRING_SIZE - 1,
"/usr/sbin/ipsec down %s >/dev/null", name);
"/usr/sbin/ipsec whack --delete --name %s >/dev/null", name);
safe_system(command);
safe_system("/usr/sbin/ipsec whack --rereadall >/dev/null");
}