From 015a8cf91340699fc18f1f54eeef3160e8c2ee9e Mon Sep 17 00:00:00 2001 From: James Gilliland Date: Mon, 2 May 2022 09:20:38 -0500 Subject: [PATCH] Fix for newer versions of pfSense. Support newer versions of pfSense without pfSense_ngctl_attach. Relates to #67 --- bin/pfatt.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/pfatt.sh b/bin/pfatt.sh index 5a69c8a..86b3e04 100755 --- a/bin/pfatt.sh +++ b/bin/pfatt.sh @@ -18,8 +18,10 @@ getTimestamp(){ echo "$(getTimestamp) RG_ETHER_ADDR: $RG_ETHER_ADDR" echo -n "$(getTimestamp) attaching interfaces to ng_ether... " - /usr/local/bin/php -r "pfSense_ngctl_attach('.', '$ONT_IF');" - /usr/local/bin/php -r "pfSense_ngctl_attach('.', '$RG_IF');" + # Only needed for older versions of pfatt. Newer versions handle this automatically. + # Eventually this can be remove. + /usr/local/bin/php -r "function_exists('pfSense_ngctl_attach') && pfSense_ngctl_attach('.', '$ONT_IF');" + /usr/local/bin/php -r "function_exists('pfSense_ngctl_attach') && pfSense_ngctl_attach('.', '$RG_IF');" echo "OK!" echo "$(getTimestamp) building netgraph nodes..."