From 72cf415ad78174672a757c3422df153f5bd17f0c Mon Sep 17 00:00:00 2001 From: Darkhand81 Date: Sat, 20 Jul 2024 20:03:11 -0500 Subject: [PATCH] net/webrepl/webrepl_setup.py: Create boot.py if it doesn't exist. Signed-off-by: Darkhand81 --- micropython/net/webrepl/webrepl_setup.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/micropython/net/webrepl/webrepl_setup.py b/micropython/net/webrepl/webrepl_setup.py index 16e5f76e6..be9cefe27 100644 --- a/micropython/net/webrepl/webrepl_setup.py +++ b/micropython/net/webrepl/webrepl_setup.py @@ -39,6 +39,12 @@ def exists(fname): return False +def validate_boot_file(): + if not exists(RC): + with open(RC, "w") as f: + f.write("# boot.py -- run on boot-up\n") + + def get_daemon_status(): with open(RC) as f: for l in f: @@ -71,6 +77,7 @@ def change_daemon(action): def main(): + validate_boot_file() status = get_daemon_status() print("WebREPL daemon auto-start status:", "enabled" if status else "disabled")