File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -105,8 +105,19 @@ curl -so /etc/pki/rpm-gpg/OpenLogic-GPG-KEY https://raw.githubusercontent.com/op
105105rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
106106rpm --import /etc/pki/rpm-gpg/OpenLogic-GPG-KEY
107107
108- # Enforce GRUB_TIMEOUT=1 and remove any existing GRUB_TIMEOUT_STYLE and append GRUB_TIMEOUT_STYLE=countdown after GRUB_TIMEOUT
109- sed -i -n -e ' s/GRUB_TIMEOUT=.*/GRUB_TIMEOUT=1/' -e ' /^GRUB_TIMEOUT_STYLE=/!p' -e ' /^GRUB_TIMEOUT=/aGRUB_TIMEOUT_STYLE=countdown' /etc/default/grub
108+ # Grab major version number so we can properly adjust grub config.
109+ # Should work on both RHEL and CentOS reliably
110+ majorVersion=$(rpm -E %{rhel})
111+
112+ [ " $majorVersion" = " 6" ] && {
113+ # GRUB: Enforce timeout=1 and append hiddenmenu after splashimage, if necessary
114+ sed -i -e ' s/timeout=.*/timeout=1/' /boot/grub/grub.conf
115+ grep -q ^hiddenmenu /boot/grub/grub.conf || sed -i -e ' /^splashimage=/ahiddenmenu' /boot/grub/grub.conf
116+ }
117+ [ " $majorVersion" != " 6" ] && {
118+ # GRUB2: Enforce GRUB_TIMEOUT=1 and remove any existing GRUB_TIMEOUT_STYLE and append GRUB_TIMEOUT_STYLE=countdown after GRUB_TIMEOUT
119+ sed -i -n -e ' s/GRUB_TIMEOUT=.*/GRUB_TIMEOUT=1/' -e ' /^GRUB_TIMEOUT_STYLE=/!p' -e ' /^GRUB_TIMEOUT=/aGRUB_TIMEOUT_STYLE=countdown' /etc/default/grub
120+ }
110121
111122# Enable SSH keepalive
112123sed -i ' s/^#\(ClientAliveInterval\).*$/\1 180/g' /etc/ssh/sshd_config
165176 EOF
166177fi
167178
168- fi
169-
170179# Download these again at the end of the post-install script so we can recreate a previous point release without current major version updates
171180# Set OL repos
172181curl -so /etc/yum.repos.d/CentOS-Base.repo https://raw.githubusercontent.com/openlogic/AzureBuildCentOS/master/config/azure/CentOS-Base.repo
You can’t perform that action at this time.
0 commit comments