Skip to content

Commit

Permalink
fix sed statement for range
Browse files Browse the repository at this point in the history
  • Loading branch information
fredclausen committed Sep 3, 2023
1 parent 75d0600 commit e25ae66
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rootfs/etc/s6-overlay/scripts/08-graphs1090-init
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if chk_enabled "${GRAPHS1090_DISABLE_CHART_CPU}"; then
fi
if chk_enabled "${GRAPHS1090_DISABLE_CHART_TEMP}"; then
sed -i '/^\s*<div class="column text-center">$/{$!{N;s/\(<div class="column text-center"\)\(>\n\s*<a id ="system-temperature-link"\)/\1 style="display:none"\2/;t;P;D}}' /usr/share/graphs1090/html/index.html
fi
fi
if chk_enabled "${GRAPHS1090_DISABLE_CHART_MEMORY}"; then
sed -i '/^\s*<div class="column text-center">$/{$!{N;s/\(<div class="column text-center"\)\(>\n\s*<a id ="system-memory-link"\)/\1 style="display:none"\2/;t;P;D}}' /usr/share/graphs1090/html/index.html
fi
Expand Down Expand Up @@ -76,11 +76,11 @@ fi
# Set range units, possible values: `nautical`, `statute`, `metric`
# shellcheck disable=SC2076
if [[ -n "${GRAPHS1090_RANGEUNITS}" ]] && [[ " nautical statute metric " =~ " ${GRAPHS1090_RANGEUNITS} " ]]; then
sed -i "s|range=.*|range=${GRAPHS1090_RANGEUNITS}|g" /etc/default/graphs1090
sed -i "s|^range=.*|range=${GRAPHS1090_RANGEUNITS}|g" /etc/default/graphs1090
elif [[ -n "${GRAPHS1090_RANGEUNITS}" ]] && [[ ! " nautical statute metric " =~ " ${GRAPHS1090_RANGEUNITS} " ]]; then
echo "[$(date)][08-graphs1090] WARNING: GRAPHS1090_RANGEUNITS set to \"${GRAPHS1090_RANGEUNITS}\", which an invalid value!"
else
sed -i "s|range=.*|range=nautical|g" /etc/default/graphs1090
sed -i "s|^range=.*|range=nautical|g" /etc/default/graphs1090
fi

# Set graph size, possible values: `small`, `default`, `large`, `huge`, `custom`
Expand All @@ -91,7 +91,7 @@ elif [[ -n "${GRAPHS1090_SIZE}" ]] && [[ ! " small default large huge custom " =
echo "[$(date)][08-graphs1090] WARNING: GRAPHS1090_SIZE set to \"${GRAPHS1090_SIZE}\", which an invalid value!"
else
sed -i "s|all_large=.*|graph_size=default|g" /etc/default/graphs1090
fi
fi

# Make the small graphs as large as the big ones by setting to `yes`
if chk_enabled "${GRAPHS1090_ALL_LARGE}"; then
Expand Down

0 comments on commit e25ae66

Please sign in to comment.