|
|
@ -23,11 +23,11 @@ boot() { |
|
|
|
} |
|
|
|
|
|
|
|
uciadd() { |
|
|
|
local iface="$1" |
|
|
|
local device="$2" |
|
|
|
local zone="$3" |
|
|
|
local iface="${1}" |
|
|
|
local device="${2}" |
|
|
|
local zone="${3}" |
|
|
|
|
|
|
|
[ -z "$iface" ] && { |
|
|
|
[ -z "${iface}" ] && { |
|
|
|
iface="docker" |
|
|
|
device="docker0" |
|
|
|
zone="docker" |
|
|
@ -77,11 +77,11 @@ uciadd() { |
|
|
|
} |
|
|
|
|
|
|
|
ucidel() { |
|
|
|
local iface="$1" |
|
|
|
local device="$2" |
|
|
|
local zone="$3" |
|
|
|
local iface="${1}" |
|
|
|
local device="${2}" |
|
|
|
local zone="${3}" |
|
|
|
|
|
|
|
[ -z "$iface" ] && { |
|
|
|
[ -z "${iface}" ] && { |
|
|
|
iface="docker" |
|
|
|
device="docker0" |
|
|
|
zone="docker" |
|
|
@ -182,20 +182,20 @@ service_triggers() { |
|
|
|
} |
|
|
|
|
|
|
|
iptables_add_blocking_rule() { |
|
|
|
local cfg="$1" |
|
|
|
local cfg="${1}" |
|
|
|
|
|
|
|
local device="" |
|
|
|
|
|
|
|
handle_iptables_rule() { |
|
|
|
local interface="$1" |
|
|
|
local outbound="$2" |
|
|
|
local interface="${1}" |
|
|
|
local outbound="${2}" |
|
|
|
|
|
|
|
local inbound="" |
|
|
|
|
|
|
|
. /lib/functions/network.sh |
|
|
|
network_get_physdev inbound "${interface}" |
|
|
|
|
|
|
|
[ -z "$inbound" ] && { |
|
|
|
[ -z "${inbound}" ] && { |
|
|
|
logger -t "dockerd-init" -p notice "Unable to get physical device for interface ${interface}" |
|
|
|
return |
|
|
|
} |
|
|
@ -206,14 +206,14 @@ iptables_add_blocking_rule() { |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
config_get device "$cfg" device |
|
|
|
config_get device "${cfg}" device |
|
|
|
|
|
|
|
[ -z "$device" ] && { |
|
|
|
[ -z "${device}" ] && { |
|
|
|
logger -t "dockerd-init" -p notice "No device configured for ${cfg}" |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
config_list_foreach "$cfg" blocked_interfaces handle_iptables_rule "$device" |
|
|
|
config_list_foreach "${cfg}" blocked_interfaces handle_iptables_rule "${device}" |
|
|
|
} |
|
|
|
|
|
|
|
stop_service() { |
|
|
|