[~] Refactor
This commit is contained in:
parent
d80801192a
commit
64ce890d44
@ -2827,6 +2827,12 @@ def share_wifi(argv):
|
|||||||
default=None,
|
default=None,
|
||||||
type=str,
|
type=str,
|
||||||
)
|
)
|
||||||
|
parser.add_option(
|
||||||
|
'--channel',
|
||||||
|
dest='channel',
|
||||||
|
default=None,
|
||||||
|
type=int,
|
||||||
|
)
|
||||||
parser.add_option(
|
parser.add_option(
|
||||||
'--ap-name',
|
'--ap-name',
|
||||||
dest='ap_name',
|
dest='ap_name',
|
||||||
@ -2891,18 +2897,22 @@ def share_wifi(argv):
|
|||||||
on_interrupt,
|
on_interrupt,
|
||||||
)
|
)
|
||||||
|
|
||||||
while True:
|
hostapd_args = [
|
||||||
try:
|
|
||||||
if hostapd is None:
|
|
||||||
print('\n%s, start new' % last_timestamp)
|
|
||||||
hostapd = subprocess.Popen([
|
|
||||||
'create_ap',
|
'create_ap',
|
||||||
'--hostapd-timestamps',
|
'--hostapd-timestamps',
|
||||||
options.to_wifi,
|
options.to_wifi,
|
||||||
options.from_eth,
|
options.from_eth,
|
||||||
options.ap_name,
|
options.ap_name,
|
||||||
pw,
|
pw,
|
||||||
])
|
]
|
||||||
|
if not options.channel is None:
|
||||||
|
hostapd_args.extend(['-c', '%d' % option.channell])
|
||||||
|
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
if hostapd is None:
|
||||||
|
print('\n%s, start new' % last_timestamp)
|
||||||
|
hostapd = subprocess.Popen(hostapd_args)
|
||||||
else:
|
else:
|
||||||
if restart:
|
if restart:
|
||||||
print('\n%s, shutdown current' % last_timestamp)
|
print('\n%s, shutdown current' % last_timestamp)
|
||||||
|
Loading…
Reference in New Issue
Block a user