Skip to content

Instantly share code, notes, and snippets.

@TomK32
Last active January 20, 2017 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomK32/eb400998843ac9d8166ecfab666aaa5e to your computer and use it in GitHub Desktop.
Save TomK32/eb400998843ac9d8166ecfab666aaa5e to your computer and use it in GitHub Desktop.
#!/bin/sh
user="tomk32"
device="x240"
mosquitto_pub -d -h mqtt.devlol.org --insecure -t "$user/$device/temp" -m "`acpi -tt|cut -d' ' -f4`"
mosquitto_pub -d -h mqtt.devlol.org --insecure -t "$user/$device/battery" -m "`acpi -b|cut -d',' -f2|cut -d' ' -f2`"
mosquitto_pub -d -h mqtt.devlol.org --insecure -t "$user/$device/mem-used" -m "`free|grep Mem|awk '{print int($3/$2 * 100)"%"}'`"
#mosquitto_pub -d -h mqtt.devlol.org --insecure -t "$user/$device/uptime" -m "`uptime`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment