net/webrepl/webrepl_setup.py: Create boot.py if it doesn't exist.

Signed-off-by: Darkhand81 <paul.lipinski@gmail.com>
pull/902/head
Darkhand81 2024-07-20 20:03:11 -05:00
rodzic fbf7e120c6
commit 72cf415ad7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0579E3485106689B
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -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")