From d13c216738f4087f24d5239923bfa0d13452f9a1 Mon Sep 17 00:00:00 2001 From: Johannes Truschnigg Date: Sat, 3 Sep 2022 19:56:07 +0200 Subject: [PATCH] Misc and minor wizard (wording) improvements --- sqm_lagthrottle_suggest_config.sh | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sqm_lagthrottle_suggest_config.sh b/sqm_lagthrottle_suggest_config.sh index 5d5b958..ad77fff 100755 --- a/sqm_lagthrottle_suggest_config.sh +++ b/sqm_lagthrottle_suggest_config.sh @@ -60,7 +60,7 @@ _h 'sqm_lagthrottle configuration wizard - WELCOME' printf 'This script will prompt you for a number of settings\n(recommending sensible defaults where thought possible)\nrequired for proper operation of sqm_lagthrottle.\n\nPlease take a few minutes to follow its instructions\nto make the most out of dynamically adjusting your\nbandwidth shaper.\n' echo "" >&2 -printf 'After this process, a configuration file drop-in will be created at\n\t%s\n\nYou may rename and use that file as your sqm_lagthrottle configuration\nfile as per its instructions.\n' "${cfgo}" >&2 +printf 'Once this wizard is done, a configuration file will be created at\n\t%s\n\nYou may use that file as your sqm_lagthrottle configuration\nfile as per its instructions.\n' "${cfgo}" >&2 echo "" >&2 _goon @@ -70,17 +70,17 @@ ifb_dev=$( (find /sys/devices/virtual/net/ -name ifb\* -print; echo sorry-no-dev if [ -e "${ifb_dev}" ] then printf 'Auto-detected downstream (rx) network device to adjust:\n\t%s\n\n' "${ifb_dev}" >&2 - printf 'Please confirm this by supplying either this device path again,\nor a custom value to replace it:\n\t' >&2 + printf 'Please confirm this by supplying either this sysfs path again,\nor provide a custom value to replace it:\n\t' >&2 read ifb_dev else - 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 + printf 'FATAL: No SQM shaping (rx) network device could be determined.\nAre you sure SQM has been set up, e.g. via luci-app-sqm?\n' >&2 exit 1 fi echo "" >&2 if ! [ -f "${ifb_dev}"///statistics/tx_bytes ] then - printf 'FATAL: No SQM shaping (rx) network device could be identified at\n\t"%s"\n' "${ifb_dev}" >&2 + printf 'FATAL: No SQM shaping (rx) network device could be identified at the supplied sysfs path\n\t"%s"\n' "${ifb_dev}" >&2 exit 1 fi @@ -91,10 +91,10 @@ 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 'Possible choices:\n\t%s\n\n' "$(cd /sys/class/net/; for dev in *; do printf '%s ' "${dev}" >&2; done)" >&2 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 + printf 'Failed to auto-detect a suitable upstream/tx interface.\nPlease key in the proper interface name.\n\t' >&2 fi read iface_tx @@ -121,13 +121,13 @@ 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}" +printf 'Effective RX bandwidth range: [%dKbps ... %dKbps]\n\n' "${bw_down_min}" "${bw_down_max}" _goon _h 'configure sqm_lagthrottle bias' -printf 'sqm_lagthrottle can be configured to prioritize bandwith over latency,\nor vice versa.\n\nIf you would prefer to keep configured target bandwidth high even in\nthe face of worsening latency/bufferbloat, please key in "bandwith" below.\n\nAll other inputs will lead to a preference for lower latency.\n\n\t' +printf 'sqm_lagthrottle can be configured to prioritize bandwith over latency,\nor vice versa.\n\nIf you would prefer to keep the dynamic target bandwidth high even in\nthe face of worsening latency/bufferbloat, please key in "bandwith" below.\n\nAll other inputs will lead to a preference for lower latency.\n\n\t' read bw_or_lat_bias -if [ x${bw_or_lat_bias} = xbandwidth ] +if [ x"${bw_or_lat_bias}" = xbandwidth ] then bw_or_lat_bias="bandwidth" else @@ -137,9 +137,9 @@ printf 'Effective choice: [%s]\n\n' "${bw_or_lat_bias}" _goon _h 'configure sqm_lagthrottle eagerness' -printf 'sqm_lagthrottle can be configured to be eager or more relaxed\nwhen making shaper adjustment decisions.\n\nWith eager mode, decisions to try to react meaningfully to changing\ncircumstances are taken more often.\n\nIn relaxed mode, the bandwidth limits will be adjusted less frequently,\nwhich MAY save some CPU time.\n\nKeying in "relaxed" below chooses that mode.\nAll other inputs will lead to eager operation.\n\n\t' +printf 'sqm_lagthrottle can be configured to be eager or relaxed\nwhen making shaper adjustment decisions.\n\nIn eager mode, decisions to try to react meaningfully to changing\ncircumstances (incrasing latency) are taken more often.\n\nIn relaxed mode, bandwidth limits will be adjusted less frequently,\nwhich MAY save some CPU time.\n\nKeying in "relaxed" below chooses that mode.\nAll other inputs will lead to eager operation.\n\n\t' read relaxed_or_eager -if [ x${relaxed_or_eager} = xrelaxed ] +if [ x"${relaxed_or_eager}" = xrelaxed ] then relaxed_or_eager="relaxed" else @@ -150,7 +150,7 @@ _goon _h 'automatic ping peer selection' -printf 'Now, we will ping potential ICMP ECHO peers for a few minutes,\nrecord stats, and determine the top four peer choices.\n\nPlease keep your Internet-directed traffic AT A MINIMUM while\nthis task is active!\n' >&2 +printf 'Now, we will ping potential ICMP ECHO peers for a few minutes,\nrecord stats, and determine the top four peer choices.\n\nPlease keep your Internet-directed traffic AT A MINIMUM while\nthis task is running!\n' >&2 _goon printf 'Performing pings, please be patient...' >&2 @@ -161,7 +161,7 @@ printf 'Performing pings, please be patient...' >&2 while [ $s -lt 120 ] do sleep 10 - printf '..' >&2 + printf '.' >&2 let s+=10 done ) & @@ -241,12 +241,12 @@ printf 'OPTIMIZATION_PREFERENCE="%s"\n' "${bw_or_lat_bias}" >> "${cfgo}" printf 'TREND_DECISION="%s"\n' "${relaxed_or_eager}" >> "${cfgo}" echo "" >&2 -printf 'Suggested configuration values saved to\n\t%s\n\n' "${cfgo}" >&2 -_goon 'Hit the [ENTER] to display full stats, or [CTRL]+[C] to exit.' >&2 +printf 'Suggested configuration was saved to\n\t%s\n\n' "${cfgo}" >&2 +_goon 'Hit the [ENTER] key to display full stats, or [CTRL]+[C] to exit.' >&2 _h 'Extended ping statistics (informational only)' cat "${sto}" >&2 echo "" >&2 -printf 'In case you missed it the first time around:\nSuggested configuration values saved to\n\t%s\n\n' "${cfgo}" >&2 +printf 'In case you missed it the first time around:\nSuggested configuration was saved to\n\t%s\n\n' "${cfgo}" >&2 rm -f "${fpo}" "${sto}" -- 2.39.5