mirror of
https://github.com/MonkWho/pfatt.git
synced 2024-11-22 18:45:13 +01:00
add OPNSENSE variable and skip pfSense specific stuff
This commit is contained in:
parent
3a1bec9a01
commit
4c541c3ab5
12
bin/pfatt.sh
12
bin/pfatt.sh
@ -4,6 +4,7 @@ set -e
|
|||||||
ONT_IF='em0'
|
ONT_IF='em0'
|
||||||
RG_IF='em1'
|
RG_IF='em1'
|
||||||
RG_ETHER_ADDR='xx:xx:xx:xx:xx:xx'
|
RG_ETHER_ADDR='xx:xx:xx:xx:xx:xx'
|
||||||
|
OPNSENSE='no'
|
||||||
LOG=/var/log/pfatt.log
|
LOG=/var/log/pfatt.log
|
||||||
|
|
||||||
getTimestamp(){
|
getTimestamp(){
|
||||||
@ -16,15 +17,18 @@ getTimestamp(){
|
|||||||
echo "$(getTimestamp) ONT_IF: $ONT_IF"
|
echo "$(getTimestamp) ONT_IF: $ONT_IF"
|
||||||
echo "$(getTimestamp) RG_IF: $RG_IF"
|
echo "$(getTimestamp) RG_IF: $RG_IF"
|
||||||
echo "$(getTimestamp) RG_ETHER_ADDR: $RG_ETHER_ADDR"
|
echo "$(getTimestamp) RG_ETHER_ADDR: $RG_ETHER_ADDR"
|
||||||
|
echo "$(getTimestamp) OPNSENSE: $OPNSENSE"
|
||||||
|
|
||||||
echo -n "$(getTimestamp) loading netgraph kernel modules... "
|
echo -n "$(getTimestamp) loading netgraph kernel modules... "
|
||||||
/sbin/kldload -nq ng_etf
|
/sbin/kldload -nq ng_etf
|
||||||
echo "OK!"
|
echo "OK!"
|
||||||
|
|
||||||
echo -n "$(getTimestamp) attaching interfaces to ng_ether... "
|
if [ ${OPNSENSE} != 'yes' ]; then
|
||||||
/usr/local/bin/php -r "pfSense_ngctl_attach('.', '$ONT_IF');"
|
echo -n "$(getTimestamp) attaching interfaces to ng_ether... "
|
||||||
/usr/local/bin/php -r "pfSense_ngctl_attach('.', '$RG_IF');"
|
/usr/local/bin/php -r "pfSense_ngctl_attach('.', '$ONT_IF');"
|
||||||
echo "OK!"
|
/usr/local/bin/php -r "pfSense_ngctl_attach('.', '$RG_IF');"
|
||||||
|
echo "OK!"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "$(getTimestamp) building netgraph nodes..."
|
echo "$(getTimestamp) building netgraph nodes..."
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user