forked from extern/shorewall_code
More largely cosmetic changes to generated script
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@4771 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
cff49eb60f
commit
058bb60e26
@ -5540,7 +5540,10 @@ __EOF__
|
||||
|
||||
append_file start
|
||||
|
||||
[ -n "$DELAYBLACKLISTLOAD" ] && refresh_blacklist
|
||||
if [ -n "$DELAYBLACKLISTLOAD" ]; then
|
||||
refresh_blacklist
|
||||
save_command
|
||||
fi
|
||||
|
||||
createchain shorewall no
|
||||
|
||||
|
@ -227,7 +227,7 @@ setup_mac_lists() # $1 = Phase Number
|
||||
if [ -n "$MACLIST_LOG_LEVEL" -o $MACLIST_DISPOSITION != ACCEPT ]; then
|
||||
indent >&3 << __EOF__
|
||||
|
||||
if interface_is_up $interface && [ \"\$(find_first_interface_address_if_any $interface)\" != 0.0.0.0 ]; then
|
||||
if interface_is_up $interface && [ "\$(find_first_interface_address_if_any $interface)" != 0.0.0.0 ]; then
|
||||
ip -f inet addr show $interface 2> /dev/null | grep 'inet.*brd' | sed 's/inet //; s/brd //; s/scope.*//;' | while read address broadcast; do
|
||||
address=\${address%/*}
|
||||
if [ -n "\$broadcast" ]; then
|
||||
|
@ -38,7 +38,7 @@
|
||||
setup_traffic_shaping()
|
||||
{
|
||||
local mtu r2q tc_all_devices device mark rate ceil prio options devfile=$(find_file tcdevices) classfile=$(find_file tcclasses) devnum=1 last_device=
|
||||
r2q=10
|
||||
r2q=10 indent=
|
||||
|
||||
rate_to_kbit() {
|
||||
local rateunit rate
|
||||
@ -175,7 +175,7 @@ setup_traffic_shaping()
|
||||
}
|
||||
|
||||
add_root_tc() {
|
||||
local defmark dev indent
|
||||
local defmark dev
|
||||
|
||||
dev=$(chain_base $device)
|
||||
|
||||
@ -212,13 +212,7 @@ setup_traffic_shaping()
|
||||
}
|
||||
|
||||
add_tc_class() {
|
||||
local full classid tospair tosmask quantum indent
|
||||
|
||||
dev=$(chain_base $device)
|
||||
|
||||
save_command "if [ -n \"\$${dev}_exists\" ] ; then"
|
||||
indent="$INDENT"
|
||||
INDENT="$INDENT "
|
||||
local full classid tospair tosmask quantum
|
||||
|
||||
full=$(get_outband_for_dev $device)
|
||||
full=$(rate_to_kbit $full)
|
||||
@ -284,9 +278,6 @@ setup_traffic_shaping()
|
||||
done
|
||||
|
||||
save_progress_message_short " TC Class $tcdev defined."
|
||||
INDENT="$indent"
|
||||
save_command fi
|
||||
save_command
|
||||
|
||||
return 0
|
||||
}
|
||||
@ -308,12 +299,37 @@ setup_traffic_shaping()
|
||||
if [ -s $TMP_DIR/tcclasses ]; then
|
||||
progress_message2 "$DOING $classfile..."
|
||||
|
||||
last_device=
|
||||
|
||||
while read device mark rate ceil prio options; do
|
||||
expandv device mark rate ceil prio options
|
||||
tcdev="$device $mark $rate $ceil $prio $options"
|
||||
options=$(separate_list $options | tr '[A-Z]' '[a-z]')
|
||||
|
||||
dev=$(chain_base $device)
|
||||
|
||||
if [ "$device" != "$last_device" ]; then
|
||||
if [ -n "$last_device" ]; then
|
||||
INDENT="$indent"
|
||||
save_command fi
|
||||
save_command
|
||||
fi
|
||||
|
||||
save_command "if [ -n \"\$${dev}_exists\" ] ; then"
|
||||
indent="$INDENT"
|
||||
INDENT="$INDENT "
|
||||
last_device=$device
|
||||
else
|
||||
save_command
|
||||
fi
|
||||
|
||||
add_tc_class && progress_message " TC Class $tcdev defined."
|
||||
last_device=$device
|
||||
done < $TMP_DIR/tcclasses
|
||||
|
||||
if [ -n "$last_device" ]; then
|
||||
INDENT="$indent"
|
||||
save_command fi
|
||||
save_command
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user