Date command needs to be run with sudo

This commit is contained in:
Ana Custura 2026-04-07 21:30:32 +01:00
parent 410f1b7913
commit 6c0fcdd295

View file

@ -218,9 +218,9 @@ def step2():
set_setting('butterbox_logo', new_value)
db.session.commit()
linux_date_arg = str(form.butterbox_date.data).replace(" ", "T") + "Z"
output = subprocess.run(["/usr/bin/date", "-s", linux_date_arg], capture_output=True, text=True)
output = subprocess.run(["sudo", "/usr/bin/date", "-s", linux_date_arg], capture_output=True, text=True)
if output.returncode != 0:
flash(f"Could not set date. Please set date manually.", category="error")
flash(f"Could not set date. Please set date manually: {output}.", category="error")
return redirect(url_for('step3'))
if get_setting("first_setup") == "true":