Last active
October 28, 2019 19:15
-
-
Save Phill93/ce35f9671d9608d38a28c06b3974b9e1 to your computer and use it in GitHub Desktop.
Script to test the battery runtime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BROKER="test.mosquitto.org" | |
TOPIC="Phill93/uptime" | |
sudo apt-get update | |
sudo apt-get install -y mosquitto-clients | |
while true; do | |
mosquitto_pub -r -h $BROKER -t $TOPIC -m "$(awk '{print int($1/3600)":"int(($1%3600)/60)":"int($1%60)}' /proc/uptime)" | |
ping -c 3 google.com | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment