2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Simplified parsing of the html table. Everything is done with awk. Got rid of cat and grep

This commit is contained in:
Finn Andersen 2014-10-30 13:33:49 +01:00
parent 771fb2dd72
commit b25acb9a2d

View File

@ -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>| <script" ' {print $2 }') )
PWR_ARRAY=( 0 $(cat $FILENAME | grep " ch_pwr" | awk -F "nowrap> | <script" ' {print $2 }') )
UP_PWR_ARRAY=( 0 $(cat $FILENAME | grep " up_pwr" | awk -F "nowrap>| <script" ' {print $2 }') )
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) )