Skip to content
Permalink
Browse files

Only patch WiFi if it exists

  • Loading branch information...
NEMS Linux
NEMS Linux committed Feb 14, 2019
1 parent 0814956 commit 45de6dcc7b82ca12c644834dc0494661be284717
Showing with 14 additions and 7 deletions.
  1. +14 −7 build/190-wifi
@@ -4,20 +4,27 @@

if [[ -e /etc/NetworkManager/NetworkManager.conf ]]; then # Do this on any board that uses Network Manager

# Detect which is the wireless interface
interface=$(iw dev | awk '$1=="Interface"{print $2}')
wifi=$(/usr/bin/nmcli r wifi | grep enabled | grep -v not | wc -l)
if [[ $wifi == 1 ]]; then # But only if wifi exists

# Disable MAC spoofing
if ! grep -q "NEMS00003" /etc/NetworkManager/NetworkManager.conf; then
# Detect which is the wireless interface
interface=$(iw dev | awk '$1=="Interface"{print $2}')

echo "
# Disable MAC spoofing
if ! grep -q "NEMS00003" /etc/NetworkManager/NetworkManager.conf; then

echo "
# NEMS00003 Set static MAC address for wlan
[device]
wifi.scan-rand-mac-address=no
" >> /etc/NetworkManager/NetworkManager.conf

# Restart the wireless network interface
/sbin/wpa_cli -i $interface reconfigure
# Restart the wireless network interface
if [[ ! $interface == "" ]]; then
/sbin/wpa_cli -i $interface reconfigure
fi

fi

fi

0 comments on commit 45de6dc

Please sign in to comment.
You can’t perform that action at this time.