From 4b97b8df9d50d2c19b996ff8fe603243b6e95bd6 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sun, 2 Dec 2018 00:57:34 -0500 Subject: [PATCH] archlinux: Handle reads through new install.sh This not only fixes the issue where set -x would cause the read line to be altered, but also separates user input from what the install scripts actually do. --- .archlinux/install-scripts/003-configure | 3 --- .archlinux/install-scripts/004-postinstall | 3 --- .archlinux/install-scripts/install.sh | 12 ++++++++++++ 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100755 .archlinux/install-scripts/install.sh diff --git a/.archlinux/install-scripts/003-configure b/.archlinux/install-scripts/003-configure index 52826c3..419b501 100755 --- a/.archlinux/install-scripts/003-configure +++ b/.archlinux/install-scripts/003-configure @@ -7,9 +7,6 @@ set -xe -echo -n "Enter a hostname for this machine: " -read HOSTNAME - # Generate the fstab file (so the filesystem is mounted on boot) genfstab -U /mnt > /mnt/etc/fstab diff --git a/.archlinux/install-scripts/004-postinstall b/.archlinux/install-scripts/004-postinstall index 55c1a4d..b60918a 100755 --- a/.archlinux/install-scripts/004-postinstall +++ b/.archlinux/install-scripts/004-postinstall @@ -7,9 +7,6 @@ set -xe -echo -n "Enter a username for the local account with administrative rights: " -read USERNAME - # Start and enable the DHCP client daemon service systemctl enable --now dhcpcd.service diff --git a/.archlinux/install-scripts/install.sh b/.archlinux/install-scripts/install.sh new file mode 100755 index 0000000..c21d1d6 --- /dev/null +++ b/.archlinux/install-scripts/install.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +echo -n "Enter a hostname for this machine: " +read HOSTNAME + +echo -n "Enter a username for the local account with sudo rights: " +read USERNAME + +env HOSTNAME="$HOSTNAME" ./003-configure +env USERNAME="$USERNAME" ./004-postinstall