Skip to content

Instantly share code, notes, and snippets.

@Phill93 Phill93/uptime.sh
Last active Oct 28, 2019

Embed
What would you like to do?
Script to test the battery runtime
#!/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
You can’t perform that action at this time.