diff options
Diffstat (limited to 'scripts/base.sh')
-rw-r--r-- | scripts/base.sh | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/scripts/base.sh b/scripts/base.sh index 08f88ee..946b130 100644 --- a/scripts/base.sh +++ b/scripts/base.sh @@ -9,16 +9,22 @@ apt-get -q -y -o \'DPkg::Options::=--force-confold\' dist-upgrade # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config -# Remove 5s grub timeout to speed up booting -cat <<EOF > /etc/default/grub -# If you change this file, run 'update-grub' afterwards to update -# /boot/grub/grub.cfg. +# Only update grub when it's installed (lxc won't have it +if [ -e /usr/sbin/update-grub ] +then + # Remove 5s grub timeout to speed up booting + # Heredoc NEEDS to be indented with tabs not spaces + # https://unix.stackexchange.com/questions/76481/cant-indent-heredoc-to-match-nestings-indent + cat <<-EOF > /etc/default/grub + # If you change this file, run 'update-grub' afterwards to update + # /boot/grub/grub.cfg. -GRUB_DEFAULT=0 -GRUB_TIMEOUT=0 -GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` -GRUB_CMDLINE_LINUX_DEFAULT="quiet" -GRUB_CMDLINE_LINUX="debian-installer=en_US" -EOF + GRUB_DEFAULT=0 + GRUB_TIMEOUT=0 + GRUB_DISTRIBUTOR=$(lsb_release -i -s 2> /dev/null || echo Debian) + GRUB_CMDLINE_LINUX_DEFAULT="quiet" + GRUB_CMDLINE_LINUX="debian-installer=en_US" + EOF -update-grub + update-grub +fi |