Skip to content

Commit 621d2fb

Browse files
InanixFRa.tricault
andauthored
Add a check for monitor mode to not set it again (#457)
Co-authored-by: a.tricault <a.tricault@inanix.fr>
1 parent 8261bed commit 621d2fb

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

wfb_ng/server.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ def init_wlans(max_bw, wlans):
113113
yield call_and_check_rc('nmcli', 'device', 'set', wlan, 'managed', 'no')
114114
yield df_sleep(1)
115115

116-
yield call_and_check_rc('ip', 'link', 'set', wlan, 'down')
117-
yield call_and_check_rc('iw', 'dev', wlan, 'set', 'monitor', 'otherbss')
118-
yield call_and_check_rc('ip', 'link', 'set', wlan, 'up')
116+
monitor_mode_satus = yield call_and_check_rc('iw', 'dev', wlan, 'info', log_stdout=False)
117+
if not b'type monitor' in monitor_mode_satus:
118+
yield call_and_check_rc('ip', 'link', 'set', wlan, 'down')
119+
yield call_and_check_rc('iw', 'dev', wlan, 'set', 'monitor', 'otherbss')
120+
yield call_and_check_rc('ip', 'link', 'set', wlan, 'up')
119121

120122
# You can set own frequency channel for each card
121123
if isinstance(settings.common.wifi_channel, dict):

0 commit comments

Comments
 (0)