1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

NM ssid detection

This commit is contained in:
Jerry Vonau 2023-04-20 10:02:34 -05:00
parent 671343b9e9
commit d831f05769

View file

@ -22,10 +22,10 @@ if [ -f /etc/wpa_supplicant/wpa_supplicant.conf ]; then
SSID=`grep ssid /etc/wpa_supplicant/wpa_supplicant.conf | awk -F = '{print $2}' | sed -r s/\"// | sed -r s/\"//`
fi
# covers netplan's bugs workaround
# https://bugs.launchpad.net/ubuntu/+source/linux-firmware/+bug/1862760
# https://bugs.launchpad.net/netplan/+bug/1951586
# WiFi country code progress on arm64 OS's discussed on #3078
# covers netplan systemd use on server with bug workarounds
if [ -f /run/netplan/wpa-$IFACE.conf ]; then
NETPLAN=1
SSID=`grep ssid /run/netplan/wpa-$IFACE.conf | awk -F = '{print $2}' | sed -r s/\"// | sed -r s/\"//`
@ -50,8 +50,14 @@ if [ -f /etc/iiab/iiab.env ]; then
SSID=$CLIENT_SSID
fi
fi
# NetworkManager
if [[ $SSID == "NA" ]]; then
SSID=$(iw $IFACE info | grep ssid | awk '{print $2}' )
fi
echo "ssid is $SSID"
if [[ $SSID == "" ]] || [[ $SSID == "NA" ]]; then
if [[ $SSID == "" ]]; then
echo "Couldn't find ssid $SSID to use exiting"
if [ $NETPLAN -eq 1 ]; then
echo "Netplan1"