mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7143: cleanup configure_gruh.sh code
Adding a check whether GRUB_TIMEOUT has already been set, and if it has, skip re-running update-grub.
This commit is contained in:
parent
29c1f91aea
commit
e5a2e67551
|
|
@ -1,5 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# Remove 5s grub timeout to speed up booting
|
||||
cat <<EOF > /etc/default/grub
|
||||
function configure_grub() {
|
||||
grep GRUB_TIMEOUT=0 /etc/default/grub && return
|
||||
|
||||
cat <<EOF > /etc/default/grub
|
||||
# If you change this file, run 'update-grub' afterwards to update
|
||||
# /boot/grub/grub.cfg.
|
||||
|
||||
|
|
@ -10,4 +18,7 @@ GRUB_CMDLINE_LINUX_DEFAULT="quiet"
|
|||
GRUB_CMDLINE_LINUX="debian-installer=en_US"
|
||||
EOF
|
||||
|
||||
update-grub
|
||||
update-grub
|
||||
}
|
||||
|
||||
return 2>/dev/null || configure_grub
|
||||
|
|
|
|||
Loading…
Reference in New Issue