cazz
September 23rd, 2017, 06:18 PM
Hi, I have got a new TP-Link HS110 that I was going to monitor how much power a computer use.
With a script I get alot of information that save to a text file
The textfile look like this.
"emeter":{"get_realtime":{"current":1.539196,"voltage":231.709784,"power":343.191153,"total":0.113000,"err_code":0}}}
That only thin I need is "343.191153" to save it in a MySQL database with timestamp
I guess I can use regex but I'm not good in that and have try to use it before with no luck.
can someone help me how to get that information I need to a variable in bash
With a script I get alot of information that save to a text file
The textfile look like this.
"emeter":{"get_realtime":{"current":1.539196,"voltage":231.709784,"power":343.191153,"total":0.113000,"err_code":0}}}
That only thin I need is "343.191153" to save it in a MySQL database with timestamp
I guess I can use regex but I'm not good in that and have try to use it before with no luck.
can someone help me how to get that information I need to a variable in bash