1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

p/cisco-epc3010_: fix tmpfile handling

This commit is contained in:
Steve Schnepp 2014-11-02 04:56:02 +01:00
parent 1c5962f240
commit c55d5e5e85

View file

@ -115,21 +115,17 @@ config)
esac
FILENAME=$(mktemp -q) && {
# Safe to use $FILENAME only within this block. Use quotes,
# since $TMPDIR, and thus $FILENAME, may contain whitespace.
FILENAME=$(mktemp -q) || exit 1
trap 'rm -f "$FILENAME"' EXIT
# Get statuspage from the modem
curl -s -o $FILENAME http://192.168.100.1/Docsis_system.asp
curl -s -o "$FILENAME" http://192.168.100.1/Docsis_system.asp
# Bash arrays starts on index 0, we 0-pad the first index. It makes it easier later on..
SNR_ARRAY=( 0 $(awk -F'[<>]' '/ ch_snr/{print $3}' $FILENAME) )
PWR_ARRAY=( 0 $(awk -F'[<>]' '/ ch_pwr/{print $3}' $FILENAME) )
UP_PWR_ARRAY=( 0 $(awk -F'[<>]' '/ up_pwr/{print $3}' $FILENAME) )
rm -f "$FILENAME"
}
SNR_ARRAY=( 0 $(awk -F'[<>]' '/ ch_snr/{print $3}' "$FILENAME") )
PWR_ARRAY=( 0 $(awk -F'[<>]' '/ ch_pwr/{print $3}' "$FILENAME") )
UP_PWR_ARRAY=( 0 $(awk -F'[<>]' '/ up_pwr/{print $3}' "$FILENAME") )
#