I would like to log the wireless signal quality and the last number of the IP-address to a text file or an IoT website. Is it possible to extract both in python and/or bash with a simple one-liner?
signal-quality: 90
ip-address: 93
EDIT: The os is the latest rasbian, if that matters.
ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{split($1,A,"."); print A[4]}'
gives you the last number of the IP address. But ` iwconfig wlan0 | grep 'Link Quality='| awk '{split($1,A,"/"); print A[1]}' ` is not working. – Markus Sep 21 '15 at 15:38iwconfig wlan0
... it will be easier to grep the part you need. :) – Hastur Sep 21 '15 at 16:17ifconfig eth | awk '{if ($1=="inet") {split($2,A,"."); print A[4]}}'
. – Hastur Sep 21 '15 at 16:23