Permalink
Browse files

Retroactively fix WiFi on Raspi boards

  • Loading branch information...
NEMS Linux
NEMS Linux committed Dec 1, 2018
1 parent c36c9c8 commit 6266c65637c1b7ad76d8d243758fb7b3fbeb8701
Showing with 27 additions and 1 deletion.
  1. +21 −0 fixes.sh
  2. +6 −1 info.sh
@@ -230,6 +230,27 @@ check process 9590 with pidfile /run/9590.pid
/root/nems/nems-admin/build/051-nagios-plugins
fi
# Create the patch log dir
if [ ! -d /var/log/nems/patches ]; then
mkdir -p /var/log/nems/patches
fi
# Fix WiFi
if [ ! -f /var/log/nems/patches/20181201-wifi ]; then
# Pi Specific
if (( $platform >= 0 )) && (( $platform <= 9 )); then
apt -y install raspberrypi-net-mods
fi
# This is the firmware for RPi WiFi but include for other boards in case needed
# May not be available and may say not found, but this only runs once, so no worries
apt -y install firmware-brcm80211
apt -y install dhcpcd5
apt -y install wireless-tools
apt -y install wpasupplicant
# Simple prevention of doing this every time fixes.sh runs
echo "Patched" > /var/log/nems/patches/20181201-wifi
fi
fi
# end 1.4.1
@@ -16,7 +16,12 @@ if [[ $COMMAND == "ip" ]]; then
elif [[ $COMMAND == "nic" ]]; then
# Show the active NIC
interface=`/sbin/route | /bin/grep '^default' | /bin/grep -o '[^ ]*$'`
# OLD way causes errors if connected to two interfaces (eg., eth0 and wlan0)
# interface=`/sbin/route | /bin/grep '^default' | /bin/grep -o '[^ ]*$'`
# NEW way (20181201) tests the route based on $host and treats that as the interface
host=google.com
host_ip=$(getent ahosts "$host" | awk '{print $1; exit}')
interface=`ip route get "$host_ip" | grep -Po '(?<=(dev )).*(?= src| proto)'`
echo $interface
elif [[ $COMMAND == "checkport" ]]; then

0 comments on commit 6266c65

Please sign in to comment.