Skip to content

Instantly share code, notes, and snippets.

@skiane
Last active August 29, 2015 14:15
Show Gist options
  • Save skiane/ed1b05399c18f531e7ae to your computer and use it in GitHub Desktop.
Save skiane/ed1b05399c18f531e7ae to your computer and use it in GitHub Desktop.
ZONE=''
# Source this file to get system timezone on CentOS/RHEL
test -f /etc/sysconfig/clock && . /etc/sysconfig/clock
# Read /etc/timezone on Debian
test -f /etc/timezone && ZONE=$(cat /etc/timezone)
# This is for CentOS7
test -x /usr/bin/timedatectl && ZONE=$(/usr/bin/timedatectl |grep -i timezone | awk '{print $2}' )
if [ ! -z "$ZONE" ]
then
racadm set iDRAC.time.timezone "$ZONE"
fi
racadm set iDRAC.NtPConfigGroup.NTP1 pool.ntp.org
racadm set iDRAC.NtPConfigGroup.NTPEnable enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment