xcat-core/xCAT/postscripts/syncclock
2012-10-31 11:22:00 +00:00

38 lines
782 B
Bash
Executable File

#!/bin/ksh
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
#(C)IBM Corp
#
. $XCATROOT/lib/functions
if TIMESERVERS=$(tabdb $SITETAB timeservers 1)
then
:
else
echo "$0: timeservers not defined in $SITETAB" | logger -t xcat -p local4.err
exit
fi
T=$(echo $TIMESERVERS | awk -F, '{print $1}')
if [ -n "$T" -a "$T" != "NA" ]
then
logger -t xcat -p local4.info "Install: sync clock"
ntpdate -bs $T 2>&1 | logger -t xcat -p local4.info
logger -t xcat "$0: the OS version is $OSVER" -p local4.info
case "$OSVER" in
rh9|rh[awe]s[34]|rh*5)
hwclock -w 2>&1 | logger -t xcat -p local4.info
;;
rh*)
setclock 2>&1 | logger -t xcat -p local4.info
;;
sles*|suse8*|suse9*|suse10)
clock -w 2>&1 | logger -t xcat -p local4.info
;;
esac
fi