esp8266/scripts/webrepl: Add optional password argument to webrepl.start()
This commit fixes issue #2045
This commit is contained in:
parent
cea1c621e0
commit
2724bd4a94
@ -49,8 +49,9 @@ def stop():
|
|||||||
listen_s.close()
|
listen_s.close()
|
||||||
|
|
||||||
|
|
||||||
def start(port=8266):
|
def start(port=8266, password=None):
|
||||||
stop()
|
stop()
|
||||||
|
if password is None:
|
||||||
try:
|
try:
|
||||||
import port_config
|
import port_config
|
||||||
_webrepl.password(port_config.WEBREPL_PASS)
|
_webrepl.password(port_config.WEBREPL_PASS)
|
||||||
@ -60,3 +61,7 @@ def start(port=8266):
|
|||||||
import webrepl_setup
|
import webrepl_setup
|
||||||
setup_conn(port, webrepl_setup.handle_conn)
|
setup_conn(port, webrepl_setup.handle_conn)
|
||||||
print("Started webrepl in setup mode")
|
print("Started webrepl in setup mode")
|
||||||
|
else:
|
||||||
|
_webrepl.password(password)
|
||||||
|
setup_conn(port, accept_conn)
|
||||||
|
print("Started webrepl in normal mode")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user