summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoderick142017-06-30 01:46:38 +0530
committercoderick142017-06-30 01:46:38 +0530
commit7775687c0f344ce0657ffcc2fa1bfafeff681e1d (patch)
tree74320f26f50a44a4c3620ed19847830f21501193
parent55c22cbfae65a242dcdf904981f5679e82458387 (diff)
downloadSBHS-2018-Rpi-7775687c0f344ce0657ffcc2fa1bfafeff681e1d.tar.gz
SBHS-2018-Rpi-7775687c0f344ce0657ffcc2fa1bfafeff681e1d.tar.bz2
SBHS-2018-Rpi-7775687c0f344ce0657ffcc2fa1bfafeff681e1d.zip
Add script to sync time between RPis and server
-rw-r--r--synctime.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/synctime.sh b/synctime.sh
new file mode 100644
index 0000000..725461a
--- /dev/null
+++ b/synctime.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Synchronize Raspberry Pi server time with master server
+# This script should be run whenever an RPi reboots
+
+cd sbhs_server/RPi_data
+
+for ip in $(cat ipaddrs.txt)
+do
+ echo $ip
+ ssh pi@$ip "sudo date --set \"$(date)\""
+done