# probably do more harm than good. Please be aware that this is work in
# progress, and the main application logic is implemented in the awk script.
-# HINT: You may want to use `sqm_lagthrottle_suggest_config.sh` from this
+# HINT: You will want to use `sqm_lagthrottle_suggest_config.sh` from this
# distribution to get (hopefully) sensible configuration values for most of
# the below settings!
-FUDGE_MS=20.0 # "fudge" factor in msec that your PING_PEERS are expected to fluctuate in latency under normal conditions
-PING_PEERS='1.1.1.1 8.8.8.8' # space-separated list of peer addresses to ping
-BW_MIN_RX=4000 # CHANGE THIS - your min. acceptable downstream bandwidth to shape to in Kbps
-BW_MAX_RX=30000 # CHANGE THIS - your max. desired downstream bandwidth to shape to in Kbps
-STATS_RX='/sys/class/net/ifb4eth1/statistics/tx_bytes' # CHANGE THIS - downstream bandwidth accounting file for your SQM'd interface
-IFACE_RX='ifb4eth1' # CHANGE THIS - interface to apply downstream SQM to
-STATS_TX='/sys/class/net/eth1/statistics/tx_bytes' # CHANGE THIS - upstream bandwidth accounting file for your SQM'd interface (presently unused)
-IFACE_TX='eth1' # CHANGE THIS - interface to apply upstream SQM to (presently unused)
-TREND_DECISION="eager" # choose either "eager" or "relaxed" - the latter trades additional CPU load for quicker decision making
-OPTIMIZATION_PREFERENCE="latency" # try to optimize for either "latency" (i.e., minimze it) or increased "bandwidth"
+## FUDGE_MS="" # "fudge" factor in msec that your PING_PEERS are expected to fluctuate in latency under normal conditions
+## PING_PEERS=""# space-separated list of peer addresses to ping
+## BW_MIN_RX="" # CHANGE THIS - your min. acceptable downstream bandwidth to shape to in Kbps
+## BW_MAX_RX="" # CHANGE THIS - your max. desired downstream bandwidth to shape to in Kbps
+## STATS_RX="" # CHANGE THIS - downstream bandwidth accounting file for your SQM'd interface
+## IFACE_RX="" # CHANGE THIS - interface to apply downstream SQM to
+## STATS_TX="" # CHANGE THIS - upstream bandwidth accounting file for your SQM'd interface (presently unused)
+## IFACE_TX="" # CHANGE THIS - interface to apply upstream SQM to (presently unused)
+## TREND_DECISION="" # choose either "eager" or "relaxed" - the latter trades additional CPU load for quicker decision making
+## OPTIMIZATION_PREFERENCE="" # try to optimize for either "latency" (i.e., minimze it) or increased "bandwidth"
# Less commonly changed config knobs
PING_SLOTS_PER_PEER=5 # number of samples per PING_PEER to calculate averages over
TZ=UTC
LC_ALL=C
export TZ LC_ALL
-SQML_CFGFILE=./sqm_lagthrottle.conf
+SQML_CFGFILE="${1:-./sqm_lagthrottle.conf}"
__is_num() {
if [ -r "${SQML_CFGFILE}" ] && sh -n "${SQML_CFGFILE}"
then
- printf '# INFO: Evaluating configuration delta from file "%s"...\n' "${SQML_CFGFILE}"
- eval "PS4='# SETTING: ' set -x; $(grep -E '[A-Z][A-Z_]+=' "${SQML_CFGFILE}"); set +x"
+ printf '# INFO: Evaluating configuration file at "%s"...\n' "${SQML_CFGFILE}"
+ eval "PS4='# CONFIG: ' set -x; $(grep -E '[A-Z][A-Z_]+=' "${SQML_CFGFILE}"); set +x"
_cfg_ok=$?
set +x
if [ ${_cfg_ok} -ne 0 ]