Skip to content

Commit

Permalink
fix for deactivated wifi on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller authored Nov 3, 2023
1 parent c12cb0f commit b4afefc
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions misc/sampleconfigs/autohotspot.sh.stretch-default2-Hotspot.sample
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,18 @@ CheckDevice()
exit 1
elif (iw dev "$wifidev" info 2>&1 >/dev/null) ; then
echo "wifi device available"
return
if (rfkill list wifi -rno HARD,SOFT | grep -i "unblocked.*unblocked") >/dev/null 2>&1 ; then
local wifidev_up=$(ip link show "$wifidev" up)
if [ -z $"wifidev_up" ]; then
ip link set dev "$wifidev" up
sleep 2
fi
return
else
echo "wifi is deactivated"
InitWPA
exit 0
fi
else
j=$((j + 1))
sleep 2
Expand Down Expand Up @@ -178,11 +189,7 @@ CheckSSID()
fi
}


CheckDevice
if (rfkill list wifi -rno HARD,SOFT | grep -i "unblocked.*unblocked") >/dev/null 2>&1
then
FindSSID
CheckSSID
else
echo "skipped - wifi is deactivated."
fi
FindSSID
CheckSSID

0 comments on commit b4afefc

Please sign in to comment.