From 4c541c3ab56ffbb5e8e41edda18dee5f40e2bc9b Mon Sep 17 00:00:00 2001 From: Larry Rosenman Date: Wed, 3 Apr 2019 14:32:52 -0500 Subject: [PATCH] add OPNSENSE variable and skip pfSense specific stuff --- bin/pfatt.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/pfatt.sh b/bin/pfatt.sh index 31167df..b35402a 100755 --- a/bin/pfatt.sh +++ b/bin/pfatt.sh @@ -4,6 +4,7 @@ set -e ONT_IF='em0' RG_IF='em1' RG_ETHER_ADDR='xx:xx:xx:xx:xx:xx' +OPNSENSE='no' LOG=/var/log/pfatt.log getTimestamp(){ @@ -16,15 +17,18 @@ getTimestamp(){ echo "$(getTimestamp) ONT_IF: $ONT_IF" echo "$(getTimestamp) RG_IF: $RG_IF" echo "$(getTimestamp) RG_ETHER_ADDR: $RG_ETHER_ADDR" + echo "$(getTimestamp) OPNSENSE: $OPNSENSE" echo -n "$(getTimestamp) loading netgraph kernel modules... " /sbin/kldload -nq ng_etf echo "OK!" - 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');" - echo "OK!" + if [ ${OPNSENSE} != 'yes' ]; then + 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');" + echo "OK!" + fi echo "$(getTimestamp) building netgraph nodes..."