qos-scripts: fix indentation

Signed-off-by: Moritz Warning <moritzwarning@web.de>
This commit is contained in:
Moritz Warning 2018-07-10 18:50:30 +02:00 committed by Hans Dedecker
parent 4630159294
commit 954faac7bc
3 changed files with 18 additions and 17 deletions

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
qos-stop qos-stop
/usr/lib/qos/generate.sh all | sh /usr/lib/qos/generate.sh all | sh

View file

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
for iface in $(tc qdisc show | grep -E '(hfsc|ingress)' | awk '{print $5}'); do for iface in $(tc qdisc show | grep -E '(hfsc|ingress)' | awk '{print $5}'); do
tc qdisc del dev "$iface" ingress 2>&- >&- tc qdisc del dev "$iface" ingress 2>&- >&-
tc qdisc del dev "$iface" root 2>&- >&- tc qdisc del dev "$iface" root 2>&- >&-

View file

@ -118,21 +118,21 @@ parse_matching_rule() {
append "$var" "-m comment --comment '$value'" append "$var" "-m comment --comment '$value'"
;; ;;
*:tos) *:tos)
add_insmod xt_dscp add_insmod xt_dscp
case "$value" in
!*) append "$var" "-m tos ! --tos $value";;
*) append "$var" "-m tos --tos $value"
esac
;;
*:dscp)
add_insmod xt_dscp
dscp_option="--dscp"
[ -z "${value%%[EBCA]*}" ] && dscp_option="--dscp-class"
case "$value" in case "$value" in
!*) append "$var" "-m dscp ! $dscp_option $value";; !*) append "$var" "-m tos ! --tos $value";;
*) append "$var" "-m dscp $dscp_option $value" *) append "$var" "-m tos --tos $value"
esac esac
;; ;;
*:dscp)
add_insmod xt_dscp
dscp_option="--dscp"
[ -z "${value%%[EBCA]*}" ] && dscp_option="--dscp-class"
case "$value" in
!*) append "$var" "-m dscp ! $dscp_option $value";;
*) append "$var" "-m dscp $dscp_option $value"
esac
;;
*:direction) *:direction)
value="$(echo "$value" | sed -e 's,-,:,g')" value="$(echo "$value" | sed -e 's,-,:,g')"
if [ "$value" = "out" ]; then if [ "$value" = "out" ]; then
@ -428,7 +428,7 @@ start_cg() {
cat <<EOF cat <<EOF
$INSMOD $INSMOD
EOF EOF
for command in $iptables; do for command in $iptables; do
cat <<EOF cat <<EOF
$command -w -t mangle -N qos_${cg} $command -w -t mangle -N qos_${cg}
@ -486,7 +486,7 @@ stop_firewall() {
-e 's/^-A/-D/' \ -e 's/^-A/-D/' \
-e '${p;g}' | -e '${p;g}' |
# Make into proper iptables calls # Make into proper iptables calls
# Note: awkward in previous call due to hold space usage # Note: awkward in previous call due to hold space usage
sed -n -e "s/^./${command} -w -t mangle &/p" sed -n -e "s/^./${command} -w -t mangle &/p"
done done
} }