diff --git a/README.md b/README.md index 6c3ca38..2ebd847 100644 --- a/README.md +++ b/README.md @@ -181,19 +181,21 @@ The `DW_EXTRA_CONFIGS` parameter can be used to add or change additional paramet ... environment: DW_EXTRA_CONFIGS= - PARAM1=value string "here"; - PARAM2=; + PARAM1 value string "here"; + PARAM2 ""; PARAM3; - PARAM4=remove + PARAM4=remove; + add:PARAM5 value string here ... ``` In this case: -- `PARAM1` is uncommented (if needed) and set with `value string "here"` (replacing any existing values if they exist) -- `PARAM2` is uncommented (if needed) and set with no value string (any existing values are removed) +- `PARAM1` is uncommented (if needed) and replaced with `value string "here"` (replacing any existing values if they exist) +- `PARAM2` is uncommented (if needed) and replaced with no value string (any existing values are removed) - `PARAM3` is uncommented (if needed) and leaving any existing value string in place - `PARAM4` is commented out +- `PARAM5` is added to the document regardless of the existence of the parameter. You can use this to add the same parameter multiple times ## Tuning the audio interface diff --git a/rootfs/etc/s6-overlay/scripts/30-set-direwolf-params b/rootfs/etc/s6-overlay/scripts/30-set-direwolf-params index 218219d..6a29d3a 100755 --- a/rootfs/etc/s6-overlay/scripts/30-set-direwolf-params +++ b/rootfs/etc/s6-overlay/scripts/30-set-direwolf-params @@ -35,7 +35,8 @@ function setdwconfig() { # function to set direwolf config item # usage: setdwconfig PARAM VALUE STRING # If VALUE STRING is not present, it will simply uncomment PARAM if it exists, or add it (without values) to the end of the config file -# If VALUE STRING is specified as "VALUE" "STRING", "VALUE STRING", or "", it will uncomment and set value to PARAM VALUE STRING, or add PARAM VALUE STRING to the end of the config file +# If VALUE STRING is specified as "VALUE" "STRING", "VALUE STRING", or "", it will uncomment and set value to PARAM VALUE STRING, or add PARAM VALUE STRING to the end of the config file if the param is not present +# If PARAM starts with "add:", it will add PARAM VALUE STRING to the end of the document regardless of the existence of the same param in the doc # If value string == "remove" (lowercase letters), then comment PARAM if it exists # # Examples: @@ -72,9 +73,10 @@ function setdwconfig() { # $value has an (empty or non-empty) value: # if $param exists in file, uncomment if needed and replace the existing value with the new value; # if $param doesn't exist, add $param and $value to the end of the file - if grep -qo "^\s*#*\s*${param}\b.*$" "$DWCONFIGFILE"; then + if grep -qo "^\s*#*\s*${param}\b.*$" "$DWCONFIGFILE" && [[ "${param:0:4}" != "add:" ]]; then sed -i "s|^\s*#*\s*${param}\b.*$|${param} ${value}|g" "$DWCONFIGFILE" else + if [[ "${param:0:4}" == "add:" ]]; then param="${param:4}"; fi { echo -n "${param}" if [[ -n "${value}" ]]; then echo " ${value}" diff --git a/rootfs/tools/docker-compose.kx1t.yml b/rootfs/tools/docker-compose.kx1t.yml index ef3662b..6b71c32 100644 --- a/rootfs/tools/docker-compose.kx1t.yml +++ b/rootfs/tools/docker-compose.kx1t.yml @@ -19,11 +19,12 @@ services: - DW_DEBUG=togm - DW_EXTRA_CONFIGS= TXDELAY=30; - CBEACON every=1:00 delay=0:10 SYMBOL=RH VIA=WIDE1-1,WIDE2-1 infocmd="telem-parm.pl KX1T-1 time_of_measurment ionizing_bg_radiation"; - CBEACON every=1:00 delay=0:12 SYMBOL=RH VIA=WIDE1-1,WIDE2-1 infocmd="telem-unit.pl KX1T-1 secs_since_epoch nSv/h"; - CBEACON every=1:00 delay=0:14 SYMBOL=RH VIA=WIDE1-1,WIDE2-1 infocmd="telem-data.pl KX1T-1 $(/tools/get_geiger.sh)"; - CBEACON every=1:00 delay=0:16 SYMBOL=RH VIA=WIDE1-1,WIDE2-1 infocmd="telem-bits.pl KX1T-1 11111111 ""https://kx1t.com/geiger Belmont MA"" "; - TBEACON remove + add:CBEACON every=1:00 delay=0:10 SYMBOL=RH VIA=WIDE1-1,WIDE2-1 infocmd="telem-parm.pl KX1T-1 time_of_measurment ionizing_bg_radiation"; + add:CBEACON every=1:00 delay=0:12 SYMBOL=RH VIA=WIDE1-1,WIDE2-1 infocmd="telem-unit.pl KX1T-1 secs_since_epoch nSv/h"; + add:CBEACON every=1:00 delay=0:14 SYMBOL=RH VIA=WIDE1-1,WIDE2-1 infocmd="telem-data.pl KX1T-1 $(/tools/get_geiger.sh)"; + add:CBEACON every=1:00 delay=0:16 SYMBOL=RH VIA=WIDE1-1,WIDE2-1 infocmd="telem-bits.pl KX1T-1 11111111 ""https://kx1t.com/geiger Belmont MA"" "; + TBEACON remove; + SMARTBEACONING remove; - DW_EXTRA_CMDLINEARGS=-r 48000 - AUDIOLEVEL_TX=64 - DW_TB_COMMENT="Ramon kx1t@amsat.org https://kx1t.com"