Prevent pi reboot due to timing issue after applying admin panel changes. Closes #8

This commit is contained in:
Ana Custura 2026-03-30 10:29:25 +01:00
parent 4c25aeabf9
commit e83914a661

View file

@ -42,7 +42,7 @@ def set_root_password(new_pass):
print(unlock_result) print(unlock_result)
return False return False
else: else:
result = run(["passwd", "-s", "root"],capture_output = True, text = True, input=new_pass) result = run(["passwd", "-s", "root"], capture_output = True, text = True, input=new_pass)
if result.returncode != 0: if result.returncode != 0:
print(f"Issue setting password for root account") print(f"Issue setting password for root account")
print(result) print(result)
@ -216,6 +216,7 @@ def check_settings(raspap_installed: bool):
needs_restart = set_root_password(load_setting('root_password')) or needs_restart needs_restart = set_root_password(load_setting('root_password')) or needs_restart
if needs_restart: if needs_restart:
print("I am restarting here") print("I am restarting here")
time.sleep(60)
run(["sudo", "reboot"]) run(["sudo", "reboot"])
if __name__ == "__main__": if __name__ == "__main__":