Settinsg syncthing permissions
This commit is contained in:
parent
ca6420f123
commit
5fdaabdaf4
|
@ -302,10 +302,25 @@ function user_devices_changed {
|
|||
done
|
||||
}
|
||||
|
||||
function syncthing_set_permissions {
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [ -d /home/$USERNAME/Sync ]; then
|
||||
chown $USERNAME:$USERNAME /home/$USERNAME /home/$USERNAME/Sync
|
||||
fi
|
||||
if [ -d /home/$USERNAME/SyncShared ]; then
|
||||
chown $USERNAME:$USERNAME /home/$USERNAME /home/$USERNAME/SyncShared
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
user_devices_changed
|
||||
if [ $CHANGED ]; then
|
||||
create_syncthing_config
|
||||
syncthing_set_permissions
|
||||
systemctl restart syncthing
|
||||
else
|
||||
syncthing_set_permissions
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue