50c6f4303346f9db31beea78c500ab482409f33d
[usb-wde1-tools.git] / munin / log-single-line.sh
1 #!/bin/sh
2 #Logs a single line into the log file passed as script parameter
3
4
5 #split words by semicolons
6 IFS=";"
7
8 #Beispielausgabe USB-WDE1:
9 # $1;1;;13,8;22,7;22,6;17,8;22,2;21,2;22,9;;59;35;38;49;38;40;35;;;;;;;0
10 # Doku des Formats in 92030_USB_WDE1_V1.0_UM.pdf bei elv.de verfügbar
11 # Format ist "Logview openformat"
12 # http://www.logview.info/cms/d_formatbeschreibung.phtml
13
14 while read -r line
15 do
16     timestamp = `date +%s`
17     echo $line sed "s/$1;1;;/$1;1;$timestamp;/"
18 done
19 echo "done with everything"