From da2430021c9e555a4750493b45ff39774e8baa97 Mon Sep 17 00:00:00 2001 From: Ing Date: Fri, 21 Feb 2025 11:20:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20SSID=20=E5=92=8C=20PSK=20?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8D=81=E5=85=AD=E8=BF=9B=E5=88=B6=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E4=BB=A5=E5=85=BC=E5=AE=B9=E9=9D=9E=E6=B3=95=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/initrd/opt/rr/boot.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/initrd/opt/rr/boot.sh b/files/initrd/opt/rr/boot.sh index d4672c13..5bce165f 100755 --- a/files/initrd/opt/rr/boot.sh +++ b/files/initrd/opt/rr/boot.sh @@ -230,8 +230,9 @@ if echo "purley broadwellnkv2" | grep -wq "${PLATFORM}"; then CMDLINE["SASmodel"]="1" fi -SSID="$(cat ${PART1_PATH}/wpa_supplicant.conf 2>/dev/null | grep 'ssid=' | cut -d'=' -f2 | sed 's/^"//; s/"$//')" -PSK="$(cat ${PART1_PATH}/wpa_supplicant.conf 2>/dev/null | grep 'psk=' | cut -d'=' -f2 | sed 's/^"//; s/"$//')" +SSID="$(cat ${PART1_PATH}/wpa_supplicant.conf 2>/dev/null | grep 'ssid=' | cut -d'=' -f2 | sed 's/^"//; s/"$//' | xxd -p | tr -d '\n')" +PSK="$(cat ${PART1_PATH}/wpa_supplicant.conf 2>/dev/null | grep 'psk=' | cut -d'=' -f2 | sed 's/^"//; s/"$//' | xxd -p | tr -d '\n')" + if [ -n "${SSID}" ] && [ -n "${PSK}" ]; then CMDLINE["wpa.ssid"]="${SSID}" CMDLINE["wpa.psk"]="${PSK}"