Skip to content

Commit

Permalink
Network i/f fallback for headless mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Jul 29, 2023
1 parent 2e0a4ba commit 9f1cb45
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions easyinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,11 @@ function fetchHardDiskDrivers() {
function setupWiredNetworking() {
echo "Setting up wired network..."

LAN_INTERFACE=`ip -o addr show scope link | awk '{split($0, a); print $2}' | grep 'eth\|enx' | head -n 1`
if [[ -z $HEADLESS ]]; then
LAN_INTERFACE=`ip -o addr show scope link | awk '{split($0, a); print $2}' | grep 'eth\|enx' | head -n 1`
else
LAN_INTERFACE="eth0"
fi

if [[ -z "$LAN_INTERFACE" ]]; then
echo "No usable wired network interfaces detected. Have you already enabled the bridge? Aborting..."
Expand Down Expand Up @@ -640,7 +644,12 @@ function setupWirelessNetworking() {
CIDR="24"
ROUTER_IP=$NETWORK.1
ROUTING_ADDRESS=$NETWORK.0/$CIDR
WLAN_INTERFACE=`ip -o addr show scope link | awk '{split($0, a); print $2}' | grep 'wlan\|wlx' | head -n 1`

if [[ -z $HEADLESS ]]; then
WLAN_INTERFACE=`ip -o addr show scope link | awk '{split($0, a); print $2}' | grep 'wlan\|wlx' | head -n 1`
else
LAN_INTERFACE="wlan0"
fi

if [[ -z "$WLAN_INTERFACE" ]]; then
echo "No usable wireless network interfaces detected. Have you already enabled the bridge? Aborting..."
Expand Down

0 comments on commit 9f1cb45

Please sign in to comment.