Lynx
Senior Member
Here is my QoS script to deal with a VPN and apply QoS with correct overhead depending on whether the VPN is active or not:
With $OVERHEAD set from the GUI as:
This needs to be replaced by:
The line:
is a little ugly.
Is there a more efficient way to increment only the first integer by $TUN_PACKET_OVERHEAD?
Code:
admin@RT-AX86U-4168:/jffs/scripts# cat /jffs/configs/cake-qos.conf.add
DLIF='br0'
DLOPTIONS='wash dual-dsthost ingress'
ULIF_TUN='tun11'
TUN_PACKET_OVERHEAD='53'
Code:
admin@RT-AX86U-4168:/jffs/scripts# cat qos-start
#!/bin/sh
(
cat <<'ADDTEXT'
#!/bin/sh
source /etc/cake-qos.conf
OVERHEAD_TUN="overhead $(($(echo $OVERHEAD |grep -o -E '[0-9]+' |sed -n '1p')+TUN_PACKET_OVERHEAD)) mpu $(echo $OVERHEAD |grep -o -E '[0-9]+' |sed -n '2p')"
case "$1" in
start)
if [[ -d /sys/class/net/"$ULIF_TUN" ]]; then
tc qdisc add dev $ULIF_TUN root cake $ULPRIOQUEUE $ULOPTIONS $ULBW $OVERHEAD_TUN $FRAMING 2>/dev/null
tc qdisc add dev $DLIF root cake $DLPRIOQUEUE $DLOPTIONS $DLBW $OVERHEAD_TUN $FRAMING 2>/dev/null
else
tc qdisc add dev $ULIF root cake $ULPRIOQUEUE $ULOPTIONS $ULBW $OVERHEAD $FRAMING 2>/dev/null
tc qdisc add dev $DLIF root cake $DLPRIOQUEUE $DLOPTIONS $DLBW $OVERHEAD $FRAMING 2>/dev/null
fi
;;
stop)
tc qdisc del dev $ULIF root 2>/dev/null
tc qdisc del dev $ULIF_TUN root 2>/dev/null
tc qdisc del dev $DLIF root 2>/dev/null
;;
*)
esac
ADDTEXT
) > /tmp/qos
Code:
OVERHEAD='overhead 38 mpu 0'
Code:
OVERHEAD='overhead {38+$TUN_PACKET_OVERHEAD} mpu 0'
Code:
OVERHEAD_TUN="overhead $(($(echo $OVERHEAD |grep -o -E '[0-9]+' |sed -n '1p')+TUN_PACKET_OVERHEAD)) mpu $(echo $OVERHEAD |grep -o -E '[0-9]+' |sed -n '2p')"
Is there a more efficient way to increment only the first integer by $TUN_PACKET_OVERHEAD?
Last edited: