mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-11 03:25:54 +02:00
Change ipsec up/down of a tunnel.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user