Skip to content

Commit 0d2a82f

Browse files
committed
use package settings
1 parent 6a5deb2 commit 0d2a82f

File tree

1 file changed

+6
-5
lines changed
  • pfSense-pkg-NetBird/files/usr/local/pkg/netbird

1 file changed

+6
-5
lines changed

pfSense-pkg-NetBird/files/usr/local/pkg/netbird/netbird.inc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ function netbird_resync_config()
3838
return;
3939
}
4040

41-
if (!empty($_POST['wireguardport'])) {
42-
$config['WgPort'] = (int)$_POST['wireguardport'];
41+
$settings = config_get_path('installedpackages/netbird/config/0', []);
42+
if (!empty($settings['wireguardport'])) {
43+
$config['WgPort'] = (int)$settings['wireguardport'];
4344
}
4445

4546
$config_map = [
@@ -54,9 +55,9 @@ function netbird_resync_config()
5455
'rosenpasspermissive' => ['RosenpassPermissive', true],
5556
];
5657

57-
foreach ($config_map as $post_key => [$json_key, $enabled_val]) {
58-
if (array_key_exists($post_key, $_POST)) {
59-
$checked = $_POST[$post_key] === 'on';
58+
foreach ($config_map as $key => [$json_key, $enabled_val]) {
59+
if (array_key_exists($key, $settings)) {
60+
$checked = $settings[$key] === 'on';
6061
$config[$json_key] = ($checked === $enabled_val);
6162
}
6263
}

0 commit comments

Comments
 (0)