aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Tygier <[email protected]>2019-12-23 14:21:08 +0000
committerXECDesign <[email protected]>2020-01-07 08:07:48 +0000
commit271177a0f781a116ddaeb485ac62d28bc18fe74c (patch)
tree8406b00dcb04574395fff88ac963047d6036b5e1
parent9d15c0f7d1d01ba65fac1d5f7ebdbcfdfb02bbed (diff)
Use tee with wpa_passphrase so errors are visable
wpa_passphrase writes its error messages to stdout, so this needs to tee so that errors are visable to user. Also need to enable pipefail so that the error code still gets caught.
-rwxr-xr-xstage2/02-net-tweaks/01-run.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/stage2/02-net-tweaks/01-run.sh b/stage2/02-net-tweaks/01-run.sh
index 154e515..63fbff7 100755
--- a/stage2/02-net-tweaks/01-run.sh
+++ b/stage2/02-net-tweaks/01-run.sh
@@ -12,7 +12,8 @@ fi
if [ -v WPA_ESSID ] && [ -v WPA_PASSWORD ]; then
on_chroot <<EOF
-wpa_passphrase "${WPA_ESSID}" "${WPA_PASSWORD}" >> "/etc/wpa_supplicant/wpa_supplicant.conf"
+set -o pipefail
+wpa_passphrase "${WPA_ESSID}" "${WPA_PASSWORD}" | tee -a "/etc/wpa_supplicant/wpa_supplicant.conf"
EOF
elif [ -v WPA_ESSID ]; then
cat >> "${ROOTFS_DIR}/etc/wpa_supplicant/wpa_supplicant.conf" << EOL