Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions lib/rdk/NM_Bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,6 @@ if [ -f $RDKV_SUPP_CONF ]; then
else
PSK=""
fi

#########################
# Key_Mgmt Extraction #
#########################
KEY_MGMT_LINE=$(grep -m 1 '^[[:space:]]*key_mgmt=' "$RDKV_SUPP_CONF")
# Extract value after '=' and remove quotes
KEY_MGMT_VALUE=$(printf '%s\n' "$KEY_MGMT_LINE" | sed 's/.*key_mgmt=//; s/"//g')

if [ "$KEY_MGMT_VALUE" = "SAE" ] || [ "$KEY_MGMT_VALUE" = "SAE FT-SAE" ]; then
KEY_MGMT=sae
else
KEY_MGMT=wpa-psk
fi
echo "`/bin/timestamp`: key_mgmt is $KEY_MGMT" >> /opt/logs/NMMonitor.log

sed -i '/network={/,/}/d' "$RDKV_SUPP_CONF"
fi
Expand Down Expand Up @@ -123,11 +109,9 @@ else
fi
if [ -z "$PSK" ]; then
#connect to wifi
nmcli conn add type wifi con-name "$SSID" autoconnect yes ifname wlan0 ssid "$SSID"
nmcli conn reload
nmcli device wifi connect "$SSID"
else
#connect to wifi
nmcli conn add type wifi con-name "$SSID" autoconnect yes ifname wlan0 ssid "$SSID" wifi-sec.key-mgmt "$KEY_MGMT" wifi-sec.psk "$PSK"
nmcli conn reload
nmcli device wifi connect "$SSID" password "$PSK"
fi
fi
Loading