mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
p/cisco-epc3010_: fix tmpfile handling
This commit is contained in:
parent
1c5962f240
commit
c55d5e5e85
1 changed files with 8 additions and 12 deletions
|
@ -115,21 +115,17 @@ config)
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
FILENAME=$(mktemp -q) && {
|
FILENAME=$(mktemp -q) || exit 1
|
||||||
# Safe to use $FILENAME only within this block. Use quotes,
|
trap 'rm -f "$FILENAME"' EXIT
|
||||||
# since $TMPDIR, and thus $FILENAME, may contain whitespace.
|
|
||||||
|
|
||||||
# Get statuspage from the modem
|
# 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..
|
# 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) )
|
SNR_ARRAY=( 0 $(awk -F'[<>]' '/ ch_snr/{print $3}' "$FILENAME") )
|
||||||
PWR_ARRAY=( 0 $(awk -F'[<>]' '/ ch_pwr/{print $3}' $FILENAME) )
|
PWR_ARRAY=( 0 $(awk -F'[<>]' '/ ch_pwr/{print $3}' "$FILENAME") )
|
||||||
UP_PWR_ARRAY=( 0 $(awk -F'[<>]' '/ up_pwr/{print $3}' $FILENAME) )
|
UP_PWR_ARRAY=( 0 $(awk -F'[<>]' '/ up_pwr/{print $3}' "$FILENAME") )
|
||||||
|
|
||||||
rm -f "$FILENAME"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue