Skip to content

Commit

Permalink
Added a script to perform the manual update
Browse files Browse the repository at this point in the history
  • Loading branch information
rogergranada committed Apr 2, 2018
1 parent f5738b3 commit df34325
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/jetson/peripheral/network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ In case the date is not automatically updated, you can force the update by stopp
$ sudo ntpd -s 192.168.2.185
$ sudo service ntp start
Finally, check if the date is updated:
A script to perform the manual update can be found in the `Github page <https://raw.githubusercontent.com/lsa-pucrs/platypus_doc/master/docs/source/jetson/scripts/update_clock.sh>`_. Finally, check if the date is updated:

.. code-block:: bash
Expand Down
19 changes: 19 additions & 0 deletions docs/source/jetson/scripts/update_clock.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# This script updates the clock of the Jetson by checking the server
# located in ``IP`` machine. The server must be broadcasting NTP in
# the connected network. In order to configure NTP server and client,
# please check
# http://platypus-boats.readthedocs.io/en/latest/source/jetson/peripheral/network.html#syncronizing-clocks-in-jetson-tk1
#

if [[ $# -ne 1 ]]; then
echo "ERROR: update clock by passing the IP of the server"
echo "./update_clock.sh 192.168.2.185"
elif [[ $1 =~ ^[0-9]+\.[0-9]+\.+[0-9]+\.[0-9]+$ ]]; then
sudo service ntp stop
sudo ntpd -s $1
sudo service ntp start
else
echo "ERROR: $1 is not a valid IP address"
fi

0 comments on commit df34325

Please sign in to comment.