+SYNSTATUSONLY="0"
+
+usage(){
+ ret=$1
+
+ cat <<EOF
+$0: usage:
+ $0 <options>
+
+ Check NTP sync status (per timedatectl's output) and offset to RTC clock.
+ The latter is particularly interesting for VMs.
+
+ -o <secs> Maximum offset to tolerate (Default: $MAX)
+ -s Check sync status only, do not diff against RTC.
+EOF
+
+ exit $ret
+}
+
+while getopts o:sh opt ; do
+ case "$opt" in
+ o) MAX="$OPTARG" ;;
+ s) SYNSTATUSONLY="1";;
+ h) usage 0
+ esac
+done
+shift $(($OPTIND - 1))
+if [ "$#" -gt 0 ]; then
+ usage 1 >&2
+fi
+