]> johannes.truschnigg.info Git - sqm_lagthrottle/commitdiff
Config wizard enhancements
authorJohannes Truschnigg <johannes@truschnigg.info>
Sat, 3 Sep 2022 13:45:31 +0000 (15:45 +0200)
committerJohannes Truschnigg <johannes@truschnigg.info>
Sat, 3 Sep 2022 13:45:31 +0000 (15:45 +0200)
sqm_lagthrottle_suggest_config.sh

index c323941ad4b0155825349c994c06c67bd2c9bccf..e61c97f95f38a2d8a6389560c7d5ee252d2619a4 100755 (executable)
@@ -63,7 +63,7 @@ then
   printf 'Please confirm this by supplying either this device path again,\nor a custom value to replace it:\n\t' >&2
   read ifb_dev
 else
-  printf 'FATAL: No SQM shaping network device could be determined.\nAre you sure SQM has been set up via luci-app-sqm?\n' >&2
+  printf 'FATAL: No SQM shaping RX network device could be determined.\nAre you sure SQM has been set up via luci-app-sqm?\n' >&2
   exit 1
 fi
 echo "" >&2
@@ -81,6 +81,7 @@ iface_tx="${iface_rx/ifb4/}"
 if [ -e /sys/class/net/"${iface_tx}" ]
 then
   printf 'Auto-detected dependent upstream (tx) device:\n\t%s\n\n' "${iface_tx}" >&2
+  printf 'Possible choices:\n\t%s\n\n' "$(cd /sys/class/net/; echo *)"
   printf 'Please confirm this by supplying either this interface name again,\nor a custom value to replace it:\n\t' >&2
 else
   printf 'Failed to auto-detect a suitable upstream/tx interface.\nPlease supply a valid sysfs device path to it.\n\t' >&2
@@ -89,10 +90,11 @@ read iface_tx
 
 if ! [ -f /sys/class/net/"${iface_tx}"///statistics/rx_bytes ]
 then
-  printf 'FATAL: No suitable network device could be identified at\n\t"%s"\n' "/sys/class/net/${iface_tx}" >&2
+  printf 'FATAL: No suitable TX network device could be identified at\n\t"%s"\n' "/sys/class/net/${iface_tx}" >&2
   exit 1
 fi
 stats_tx=/sys/class/net/"${iface_tx}"/statistics/rx_bytes
+printf '\nEffective RX interface: [%s] - TX interface: [%s]\n' "${iface_rx}" "${iface_tx}"
 _goon
 
 _h "set bandwidth limits"
@@ -109,6 +111,7 @@ then
   printf 'FATAL: Maximum shaping bandwith must be greater than the minimum.\n'
   exit 1
 fi
+printf 'Effective RX bandwidth range: [%d ... %d Kbps]\n\n' "${bw_down_min}" "${bw_down_max}"
 _goon
 
 _h "configure sqm_lagthrottle bias"