Skip to content

Commit

Permalink
fixup autogain978 switched total/strong files (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf authored Sep 22, 2024
1 parent b81c483 commit 3f0c39b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/scripts/autogain
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function collect_gain_values() {
exec 3>&-

GAIN_COLLECTION="$total_msg;$strong_msg;"
if (( strong_msg * total_msg > 0 )); then
if (( total_msg > 0 )); then
GAIN_COLLECTION="${GAIN_COLLECTION}$(bc -l <<< "scale=1; 100 * $strong_msg / $total_msg / 1")"
else
GAIN_COLLECTION="${GAIN_COLLECTION}na"
Expand Down
4 changes: 2 additions & 2 deletions rootfs/usr/local/bin/autogain978
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ if [[ -z $oldstrong ]] || [[ -z $oldtotal ]]; then
fi

# use the values that were passed in via the commandline. Format is "total;strong;strong_pct" but we only use total and strong here
total="$(awk -F';' '{print $1}' <<< "$1" | tee $autogain_dir/strong)"
strong="$(awk -F';' '{print $2}' <<< "$1"| tee $autogain_dir/total)"
total="$(awk -F';' '{print $1}' <<< "$1" | tee $autogain_dir/total)"
strong="$(awk -F';' '{print $2}' <<< "$1"| tee $autogain_dir/strong)"

if [[ -z "$strong" ]] || [[ -z "$total" ]]; then
echo "[INFO] Stats not yet ready. Skipping this $(basename "$0") run"
Expand Down

0 comments on commit 3f0c39b

Please sign in to comment.