diff --git a/arcroft/build-arcroft.sh b/arcroft/build-arcroft.sh index 0fd0aca..4ebd41f 100755 --- a/arcroft/build-arcroft.sh +++ b/arcroft/build-arcroft.sh @@ -93,7 +93,8 @@ done # make sure variables are set, or use defaults. if [[ -n "${imageWifi}" ]]; then - export imageWifi + export imageWifiESSID="$(grep 'ESSID=' "${imageWifi}" | cut -d = -f2)" + export imageWifiKey="$(grep 'Key=' "${imageWifi}" | cut -d = -f2)" fi export imageVersion="${imageVersion:-4}" export imageSize="${imageSize:-8G}" @@ -147,7 +148,6 @@ wget "${url[$imageVersion]}" -O- | bsdtar -xpf - -C /mnt # Set up wifi if [[ -n "${imageWifi}" ]]; then mkdir -v "/mnt/etc/netctl" - cp -v "${imageWifi}" "/mnt/etc/netctl" fi # Create Mycroft service file cat << 'EOF' > /mnt/etc/systemd/system/mycroft.service @@ -223,7 +223,7 @@ echo mycroft > /etc/hostname # Enable services systemctl enable mycroft sshd if [[ -n "${imageWifi}" ]]; then - netctl enable "${imageWifi##*/}" + netctl enable "mycroft" fi # Update fstab for Raspberry Pi 4. #[[ $imageVersion -eq 4 ]] && sed -i 's/mmcblk0/mmcblk1/g' /etc/fstab