summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-11-05 13:16:18 +0100
committervarac <varacanero@zeromail.org>2016-11-05 13:16:18 +0100
commite7adc00728db535ff05bada15cfa5597b7542623 (patch)
tree74bda9733cd3008474c1f3d623be3af5e8bab98c /scripts
parent130d01ac8927e086670e14d13e02009896547eb7 (diff)
First working lxc build
Diffstat (limited to 'scripts')
-rw-r--r--scripts/base.sh28
-rw-r--r--scripts/custom.sh2
2 files changed, 18 insertions, 12 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
diff --git a/scripts/custom.sh b/scripts/custom.sh
index b5ec11b..7a0a54f 100644
--- a/scripts/custom.sh
+++ b/scripts/custom.sh
@@ -5,7 +5,7 @@ sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_c
# install additional packages
# openssl is needed to set root pw later
-apt-get -y install puppet lsb-release facter rsync curl openssl bash-completion
+apt-get -y install puppet lsb-release facter rsync curl openssl bash-completion wget
# Set root pw
usermod -p "$(echo vagrant | openssl passwd -1 -stdin)" root