-
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
#!/bin/bash | ||
# | ||
# script to check if the system date & time is synced with a ntp server or something else (ie gnss receiver). | ||
# script to check if the system date & time is synced. | ||
# It is used to be sure that the logfile name will be correct. | ||
|
||
# if you want to use your gnss receiver to set time date and maybe use pps, you need | ||
# to change this script to use ntpstat instead of timedatectl and modifying the str2str_file.service unit file dependencies | ||
# to ntp.service or something else. | ||
|
||
ntp_exit_code=1 | ||
while [ ${ntp_exit_code} -ne 0 ] | ||
do | ||
sleep 1 | ||
ntpstat > /dev/null | ||
timedatectl show | grep 'NTPSynchronized=yes' > /dev/null | ||
ntp_exit_code=$? | ||
done | ||
exit 0 |
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