security/pfSense-pkg-Tailscale: reduce config init calls

This commit is contained in:
Marcos Mendoza
2024-10-15 15:37:44 -06:00
parent ee09acc554
commit dd2b3f235f
2 changed files with 2 additions and 6 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
PORTNAME= pfSense-pkg-Tailscale
PORTVERSION= 0.1.7
PORTVERSION= 0.1.8
CATEGORIES= security
MASTER_SITES= # empty
DISTFILES= # empty
@@ -48,8 +48,6 @@ function tailscale_ifgroup_install()
$tailscale_entry = tailscale_ifgroup_entry();
config_init_path('ifgroups/ifgroupentry');
foreach (config_get_path('ifgroups/ifgroupentry', []) as $entry)
if ($has_ifgroup = ($entry['ifname'] === $tailscale_entry['ifname']))
break;
@@ -57,7 +55,7 @@ function tailscale_ifgroup_install()
if ($has_ifgroup)
return;
$ifgroups_config = config_get_path('ifgroups/ifgroupentry');
$ifgroups_config = config_get_path('ifgroups/ifgroupentry', []);
array_unshift($ifgroups_config, $tailscale_entry);
config_set_path('ifgroups/ifgroupentry', $ifgroups_config);
@@ -73,8 +71,6 @@ function tailscale_ifgroup_deinstall()
$tailscale_entry = tailscale_ifgroup_entry();
config_init_path('ifgroups/ifgroupentry');
foreach (config_get_path('ifgroups/ifgroupentry', []) as $idx => $entry)
if ($entry['ifname'] === $tailscale_entry['ifname']) {
config_del_path("ifgroups/ifgroupentry/{$idx}");