From 24c852a04cacf5f7c1ce7a775a2b3817edd79aa7 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Sun, 7 May 2023 22:01:43 +0000 Subject: [PATCH] Restart syncthing after root password change if it is enabled. --- packages/jelos/sources/scripts/setrootpass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/jelos/sources/scripts/setrootpass b/packages/jelos/sources/scripts/setrootpass index 70453eaa3..7a29a263e 100755 --- a/packages/jelos/sources/scripts/setrootpass +++ b/packages/jelos/sources/scripts/setrootpass @@ -19,7 +19,14 @@ sed -i "s#root:${CURRENT}:${LPC}::::::#root:${NEW}:${LPC}::::::#g" /storage/.cac echo -ne "${ROOTPASS}\n${ROOTPASS}\n" | smbpasswd -sa root 2>/dev/null # Set the root user and password for SyncThing -syncthing generate --gui-user "root" --gui-password "${ROOTPASS}" +syncthing generate --gui-user "root" --gui-password "${ROOTPASS}" >/dev/null 2>&1 # Save the password so we can display it in ES set_setting root.password "${ROOTPASS}" + +# Restart syncthing if it was enabled. +SYNCSTATUS=$(get_setting syncthing.enabled) +if [ "${SYNCSTATUS}" = "1" ] +then + systemctl restart syncthing >/dev/null 2>&1 +fi