mirror of https://github.com/MonkWho/pfatt.git
Removed refferences to OPNSense. All OPNSense stuff now lives in opnatt.sh
This commit is contained in:
parent
cbb50f1ba5
commit
d0dce2d810
31
bin/pfatt.sh
31
bin/pfatt.sh
|
@ -4,15 +4,12 @@ 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
|
||||||
|
|
||||||
if [ ${OPNSENSE} != 'yes' ]; then
|
# Calculate pfsense version so we can manage some variations.
|
||||||
# Calculate pfsense version so we can manage some variations.
|
VERSION_MAJOR=`sed -nre 's/([0-9])+\.([0-9])+\.([0-9])+.*/\1/p' /etc/version`
|
||||||
VERSION_MAJOR=`sed -nre 's/([0-9])+\.([0-9])+\.([0-9])+.*/\1/p' /etc/version`
|
VERSION_MINOR=`sed -nre 's/([0-9])+\.([0-9])+\.([0-9])+.*/\2/p' /etc/version`
|
||||||
VERSION_MINOR=`sed -nre 's/([0-9])+\.([0-9])+\.([0-9])+.*/\2/p' /etc/version`
|
VERSION_PATCH=`sed -nre 's/([0-9])+\.([0-9])+\.([0-9])+.*/\3/p' /etc/version`
|
||||||
VERSION_PATCH=`sed -nre 's/([0-9])+\.([0-9])+\.([0-9])+.*/\3/p' /etc/version`
|
|
||||||
fi
|
|
||||||
|
|
||||||
getTimestamp(){
|
getTimestamp(){
|
||||||
echo `date "+%Y-%m-%d %H:%M:%S :: [pfatt.sh] ::"`
|
echo `date "+%Y-%m-%d %H:%M:%S :: [pfatt.sh] ::"`
|
||||||
|
@ -24,7 +21,6 @@ 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"
|
|
||||||
|
|
||||||
if ( [ ${VERSION_MAJOR} -ge '2' ] && [ ${VERSION_MINOR} -ge '4' ] && [ ${VERSION_PATCH} -lt '5' ] ); then
|
if ( [ ${VERSION_MAJOR} -ge '2' ] && [ ${VERSION_MINOR} -ge '4' ] && [ ${VERSION_PATCH} -lt '5' ] ); then
|
||||||
echo -n "$(getTimestamp) loading netgraph kernel modules... "
|
echo -n "$(getTimestamp) loading netgraph kernel modules... "
|
||||||
|
@ -32,21 +28,10 @@ getTimestamp(){
|
||||||
echo "OK!"
|
echo "OK!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${OPNSENSE} = 'yes' ]; then
|
echo -n "$(getTimestamp) attaching interfaces to ng_ether... "
|
||||||
/sbin/kldload -nq netgraph
|
/usr/local/bin/php -r "pfSense_ngctl_attach('.', '$ONT_IF');"
|
||||||
/sbin/kldload -nq ng_ether
|
/usr/local/bin/php -r "pfSense_ngctl_attach('.', '$RG_IF');"
|
||||||
/sbin/kldload -nq ng_etf
|
echo "OK!"
|
||||||
/sbin/kldload -nq ng_vlan
|
|
||||||
/sbin/kldload -nq ng_eiface
|
|
||||||
/sbin/kldload -nq ng_one2many
|
|
||||||
fi
|
|
||||||
|
|
||||||
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..."
|
echo "$(getTimestamp) building netgraph nodes..."
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue