3 # a simple time update script that traps output from rdate, since we
4 # get a lot of noise even when a successful update occurs, to whit:
5 # "rdate: Could not read data: Success"
7 # author: chris koeritz
9 #hmmm: the generalized pattern of show output only on error is embodied below. make it a function.
11 outfile="$(mktemp /tmp/update_system_time.XXXXXX)"
12 /usr/bin/rdate -s time.nist.gov &> "$outfile"
14 if [ $retval -ne 0 ]; then
15 echo "Actual error code $retval returned by rdate, with output:"