Skip to content

Commit

Permalink
Use tee with wpa_passphrase so errors are visable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
samtygier authored and XECDesign committed Jan 7, 2020
1 parent 9d15c0f commit 271177a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stage2/02-net-tweaks/01-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 271177a

Please sign in to comment.