File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ def _add_global_args(self, glob):
59
59
action = 'store' ,
60
60
dest = 'channel' ,
61
61
metavar = '[channel]' ,
62
- type = int ,
63
- help = Color . s ( 'Wireless channel to scan (default: {G}all 2Ghz channels{W})' ))
62
+ help = Color . s ( 'Wireless channel to scan e.g. {C}1,3-6{W} ' +
63
+ ' (default: {G}all 2Ghz channels{W})' ))
64
64
glob .add_argument ('--channel' , help = argparse .SUPPRESS , action = 'store' ,
65
- dest = 'channel' , type = int )
65
+ dest = 'channel' )
66
66
67
67
glob .add_argument ('-5' ,
68
68
'--5ghz' ,
Original file line number Diff line number Diff line change 2
2
# -*- coding: utf-8 -*-
3
3
4
4
import os
5
+ import re
5
6
6
7
from .util .color import Color
7
8
from .tools .macchanger import Macchanger
@@ -191,6 +192,10 @@ def parse_settings_args(cls, args):
191
192
'when scanning & attacking' )
192
193
193
194
if args .channel :
195
+ chn_arg_re = re .compile ("^[0-9]+((,[0-9]+)|(-[0-9]+,[0-9]+))*(-[0-9]+)?$" )
196
+ if not chn_arg_re .match (args .channel ):
197
+ raise ValueError ("Invalid channel! The format must be 1,3-6,9" )
198
+
194
199
cls .target_channel = args .channel
195
200
Color .pl ('{+} {C}option:{W} scanning for targets on channel ' +
196
201
'{G}%s{W}' % args .channel )
You can’t perform that action at this time.
0 commit comments