From c0229a01bd8244e2b05c088442221150f0e0e185 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 24 Sep 2015 14:12:01 -0300 Subject: Redirection fixes --- share/hydractl/provision | 50 ++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'share') diff --git a/share/hydractl/provision b/share/hydractl/provision index 53cab77..a5191be 100755 --- a/share/hydractl/provision +++ b/share/hydractl/provision @@ -288,20 +288,20 @@ echo "Applying initial configuration..." hydra_sudo_run mount none -t proc $WORK/proc hydra_sudo_run mount none -t sysfs $WORK/sys hydra_sudo_run mount -o bind /dev/ $WORK/dev -echo LANG=C | $SUDO tee $WORK/etc/default/locale +echo LANG=C | $SUDO tee $WORK/etc/default/locale > /dev/null # Resolver configuration. -echo "domain $domain" | $SUDO tee $WORK/etc/resolv.conf -echo "search $hostname.$domain" | $SUDO tee -a $WORK/etc/resolv.conf -grep nameserver /etc/resolv.conf | $SUDO tee -a $WORK/etc/resolv.conf +echo "domain $domain" | $SUDO tee $WORK/etc/resolv.conf > /dev/null +echo "search $hostname.$domain" | $SUDO tee -a $WORK/etc/resolv.conf > /dev/null +grep nameserver /etc/resolv.conf | $SUDO tee -a $WORK/etc/resolv.conf > /dev/null # Hostname configuration. -echo $hostname.$domain | $SUDO tee $WORK/etc/hostname -echo "127.0.0.1 localhost" | $SUDO tee -a $WORK/etc/hosts -echo "127.0.0.1 $hostname $hostname.$domain" | $SUDO tee -a $WORK/etc/hosts +echo $hostname.$domain | $SUDO tee $WORK/etc/hostname > /dev/null +echo "127.0.0.1 localhost" | $SUDO tee -a $WORK/etc/hosts > /dev/null +echo "127.0.0.1 $hostname $hostname.$domain" | $SUDO tee -a $WORK/etc/hosts > /dev/null # Invert hostname contents to avoid http://projects.puppetlabs.com/issues/2533 -tac $WORK/etc/hosts | $SUDO tee $WORK/etc/hosts.new +tac $WORK/etc/hosts | $SUDO tee $WORK/etc/hosts.new > /dev/null hydra_sudo_run mv $WORK/etc/hosts.new $WORK/etc/hosts # Initial upgrade. @@ -312,64 +312,64 @@ hydra_sudo_run chroot $WORK/ apt-get install locales cryptsetup lvm2 initramfs-t # Crypttab. echo "Configuring crypttab..." -echo "# " | $SUDO tee $WORK/etc/crypttab +echo "# " | $SUDO tee $WORK/etc/crypttab > /dev/null if [ "$encrypt" == "y" ]; then - cat <<-EOF | $SUDO tee $WORK/etc/crypttab + cat <<-EOF | $SUDO tee $WORK/etc/crypttab > /dev/null root /dev/mapper/$vg-root none luks EOF fi if [ "$home_size" != "0" ] && [ "$encrypt" == "y" ]; then - cat <<-EOF | $SUDO tee -a $WORK/etc/crypttab + cat <<-EOF | $SUDO tee -a $WORK/etc/crypttab > /dev/null home /dev/mapper/$vg-home none luks EOF fi if [ "$var_size" != "0" ] && [ "$encrypt" == "y" ]; then - cat <<-EOF | $SUDO tee -a $WORK/etc/crypttab + cat <<-EOF | $SUDO tee -a $WORK/etc/crypttab > /dev/null var /dev/mapper/$vg-var none luks EOF fi if [ "$swap_size" != "0" ] && [ "$random_swap" == "y" ]; then - cat <<-EOF | $SUDO tee -a $WORK/etc/crypttab + cat <<-EOF | $SUDO tee -a $WORK/etc/crypttab > /dev/null swap /dev/mapper/$vg-swap /dev/random swap,cipher=aes-xts-plain64:sha256 EOF fi if [ "$swap_size" != "0" ] && [ "$random_swap" != "y" ]; then - cat <<-EOF | $SUDO tee -a $WORK/etc/crypttab + cat <<-EOF | $SUDO tee -a $WORK/etc/crypttab > /dev/null swap /dev/mapper/$vg-swap none luks,swap EOF fi # Fstab. echo "Configuring fstab..." -echo "" | $SUDO tee $WORK/etc/fstab +echo "" | $SUDO tee $WORK/etc/fstab > /dev/null if [ "$swap_size" != "0" ]; then - cat <<-EOF | $SUDO tee -a $WORK/etc/fstab + cat <<-EOF | $SUDO tee -a $WORK/etc/fstab > /dev/null /dev/mapper/swap none swap sw 0 0 EOF fi if [ "$encrypt" == "y" ]; then - cat <<-EOF | $SUDO tee -a $WORK/etc/fstab + cat <<-EOF | $SUDO tee -a $WORK/etc/fstab > /dev/null /dev/mapper/root / ext4 defaults,errors=remount-ro 0 1 EOF else - cat <<-EOF | $SUDO tee -a $WORK/etc/fstab + cat <<-EOF | $SUDO tee -a $WORK/etc/fstab > /dev/null /dev/mapper/$vg-root / ext4 defaults,errors=remount-ro 0 1 EOF fi if [ "$home_size" != "0" ]; then if [ "$encrypt" == "y" ]; then - cat <<-EOF | $SUDO tee -a $WORK/etc/fstab + cat <<-EOF | $SUDO tee -a $WORK/etc/fstab > /dev/null /dev/mapper/home /home ext4 defaults,errors=remount-ro 0 2 EOF else - cat <<-EOF | $SUDO tee -a $WORK/etc/fstab + cat <<-EOF | $SUDO tee -a $WORK/etc/fstab > /dev/null /dev/mapper/$vg-home /home ext4 defaults,errors=remount-ro 0 2 EOF fi @@ -377,11 +377,11 @@ fi if [ "$var_size" != "0" ]; then if [ "$encrypt" == "y" ]; then - cat <<-EOF | $SUDO tee -a $WORK/etc/fstab + cat <<-EOF | $SUDO tee -a $WORK/etc/fstab > /dev/null /dev/mapper/var /var ext4 defaults,errors=remount-ro 0 2 EOF else - cat <<-EOF | $SUDO tee -a $WORK/etc/fstab + cat <<-EOF | $SUDO tee -a $WORK/etc/fstab > /dev/null /dev/mapper/$vg-var /var ext4 defaults,errors=remount-ro 0 2 EOF fi @@ -392,7 +392,7 @@ if [ "$grub" == "y" ]; then echo "Boot device setup..." hydra_sudo_run mkfs.ext4 $boot_device hydra_sudo_run mount $boot_device $WORK/boot - echo "$reboot_device /boot ext4 defaults,errors=remount-ro 0 2" | $SUDO tee -a $WORK/etc/fstab + echo "$reboot_device /boot ext4 defaults,errors=remount-ro 0 2" | $SUDO tee -a $WORK/etc/fstab > /dev/null echo "Setting up GRUB..." hydra_sudo_run chroot $WORK/ apt-get install grub-pc -y @@ -400,7 +400,7 @@ fi # Kernel. echo "Installing kernel..." -cat <<-EOF | $SUDO tee $WORK/etc/initramfs-tools/modules +cat <<-EOF | $SUDO tee $WORK/etc/initramfs-tools/modules > /dev/null dm-mod dm-crypt dm-raid @@ -409,7 +409,7 @@ twofish sha256 EOF -cat <<-EOF | $SUDO tee $WORK/etc/kernel-img.conf +cat <<-EOF | $SUDO tee $WORK/etc/kernel-img.conf > /dev/null do_initrd = Yes EOF -- cgit v1.2.3