Skip to content

Commit

Permalink
net/webrepl/webrepl_setup.py: Create boot.py if it doesn't exist.
Browse files Browse the repository at this point in the history
Check for boot.py during setup and create it if it doesn't exist
  • Loading branch information
Darkhand81 committed Jul 20, 2024
1 parent fbf7e12 commit 81550a4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions micropython/net/webrepl/webrepl_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 81550a4

Please sign in to comment.