mirror of
https://github.com/netbirdio/FreeBSD-ports.git
synced 2026-05-22 18:42:42 -07:00
security/pfSense-pkg-Tailscale: reduce config init calls
This commit is contained in:
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user