Restart syncthing after root password change if it is enabled.
This commit is contained in:
parent
69ace26da8
commit
24c852a04c
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue