From b25acb9a2dc2112c552d58eebdfe915de343b1f4 Mon Sep 17 00:00:00 2001 From: Finn Andersen Date: Thu, 30 Oct 2014 13:33:49 +0100 Subject: [PATCH] Simplified parsing of the html table. Everything is done with awk. Got rid of cat and grep --- plugins/modem/cisco-epc3010_ | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/modem/cisco-epc3010_ b/plugins/modem/cisco-epc3010_ index 7cdf846b..58e7565f 100755 --- a/plugins/modem/cisco-epc3010_ +++ b/plugins/modem/cisco-epc3010_ @@ -124,9 +124,9 @@ 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 $(cat $FILENAME | grep " ch_snr" | awk -F "nowrap>| | | ]' '/ 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) )