mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
add sleeps to let kernel load and set up devices
add powersave off as nexmon suggests pick auto mode more instead of manu
This commit is contained in:
@ -25,15 +25,20 @@ reload_brcm() {
|
|||||||
if ! modprobe -r brcmfmac; then
|
if ! modprobe -r brcmfmac; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
sleep 1
|
||||||
if ! modprobe brcmfmac; then
|
if ! modprobe brcmfmac; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
sleep 2
|
||||||
|
iw dev wlan0 set power_save off
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# starts mon0
|
# starts mon0
|
||||||
start_monitor_interface() {
|
start_monitor_interface() {
|
||||||
|
iw dev wlan0 set power_save off
|
||||||
iw phy "$(iw phy | head -1 | cut -d" " -f2)" interface add mon0 type monitor
|
iw phy "$(iw phy | head -1 | cut -d" " -f2)" interface add mon0 type monitor
|
||||||
|
sleep 2
|
||||||
ifconfig wlan0 down
|
ifconfig wlan0 down
|
||||||
ifconfig mon0 up
|
ifconfig mon0 up
|
||||||
}
|
}
|
||||||
@ -69,12 +74,12 @@ is_auto_mode() {
|
|||||||
|
|
||||||
# if usb0 is up, we're in MANU
|
# if usb0 is up, we're in MANU
|
||||||
if is_interface_up usb0; then
|
if is_interface_up usb0; then
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if eth0 is up (for other boards), we're in MANU
|
# if eth0 is up (for other boards), we're in MANU
|
||||||
if is_interface_up eth0; then
|
if is_interface_up eth0; then
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# no override, but none of the interfaces is up -> AUTO
|
# no override, but none of the interfaces is up -> AUTO
|
||||||
|
Reference in New Issue
Block a user