Skip to content

Commit 9ecb26b

Browse files
committed
Still working on gateway up/down on service start/stop
1 parent f46acda commit 9ecb26b

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

net/pfSense-pkg-WireGuard/files/usr/local/pkg/wireguard/includes/wg_api.inc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ function wg_ifconfig_if_destroy($if_name, &$cmds = null) {
433433
return ($ret_code == 0);
434434
}
435435

436-
function wg_gateways_set_enable($enable = true) {
436+
function wg_gateways_set_enable($enable = true, $filter_configure = true) {
437437
$gws = return_gateways_array(true);
438438

439439
// Assume nothing will be done
@@ -455,11 +455,9 @@ function wg_gateways_set_enable($enable = true) {
455455

456456
wg_write_config("{$action} all WireGuard gateways.", false);
457457

458-
// and now restart dpinger
459-
setup_gateways_monitor();
460-
461-
// Now we need to reconfigure the packet filter rules
462-
filter_configure();
458+
if ($filter_configure) {
459+
filter_configure();
460+
}
463461
}
464462

465463
/*

net/pfSense-pkg-WireGuard/files/usr/local/pkg/wireguard/includes/wg_install.inc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ function wg_install() {
4040

4141
$g['wireguard_installing'] = true;
4242

43-
update_status("\n Upgrading any existing WireGuard XML configuration...");
44-
4543
update_status("done.\n Installing WireGuard early shell commands...");
4644

4745
// Installs the WireGuard earlyshellcmds
@@ -117,12 +115,7 @@ function wg_deinstall() {
117115
// Stop and remove the WireGuard service
118116
wg_service_deinstall(true);
119117

120-
update_status("done.\n Disabling any WireGuard gateways...");
121-
122-
// Disables any WireGuard gateways as these interfaces are now gone
123-
wg_gateways_set_enable(false);
124-
125-
update_status("done.\n");
118+
update_status("done.\n");
126119
}
127120

128121
function wg_delete_temp_files() {

net/pfSense-pkg-WireGuard/files/usr/local/pkg/wireguard/includes/wg_service.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ function wg_service_cli_stop($serialize = true) {
158158
// Disable any WireGuard gateways configured on the system.
159159
wg_gateways_set_enable(false);
160160

161+
// Now we restart any additional services
162+
$ret_code |= wg_restart_extra_services();
163+
161164
return $ret_code;
162165
}
163166

0 commit comments

Comments
 (0)