mirror of
https://github.com/novatiq/packages.git
synced 2026-04-24 21:14:40 +01:00
Merge pull request #8319 from brianjmurrell/shorewall-iface-update
Shorewall: start and enable interfaces all in hotplug
This commit is contained in:
@@ -14,7 +14,7 @@ PKG_BUGFIX_MAJOR_VERSION:=3
|
||||
PKG_BUGFIX_MINOR_VERSION:=.2
|
||||
PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION)
|
||||
PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
|
||||
http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
# should restart shorewall when an interface comes up
|
||||
DEVICE=${DEVICE:-$(/sbin/uci -p /var/state get network."$INTERFACE".ifname)}
|
||||
|
||||
case "$ACTION" in
|
||||
ifup)
|
||||
/etc/init.d/shorewall restart
|
||||
if [ "$INTERFACE" = "lan" ]; then
|
||||
/usr/sbin/shorewall start
|
||||
elif [ "${INTERFACE:0:3}" = "wan" ] &&
|
||||
[ "${INTERFACE:$((${#INTERFACE}-2)):2}" != "_6" ]; then
|
||||
/etc/shorewall/state/firewall enable "$DEVICE"
|
||||
fi
|
||||
;;
|
||||
ifdown)
|
||||
# might need to restore some routing
|
||||
/etc/init.d/shorewall restart
|
||||
if [ "${INTERFACE:0:3}" = "wan" ]; then
|
||||
/etc/shorewall/state/firewall disable "$DEVICE"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user