nextcloud/user_run: reactivate _nc_first single-folder guard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel unbrot Pätzold
2026-05-04 14:12:41 +02:00
parent fb726795db
commit f04bbdf9f1
@@ -84,7 +84,7 @@ if [ -n "${_nc_bak_list}" ]; then
fi fi
#Loop through all Entries #Loop through all Entries
#_nc_first=1 _nc_first=1
_nc_wipe_done=0 _nc_wipe_done=0
for CLIENT_DATA_DECLARE_LINE in "${CLIENT_DATA_SYNC[@]}"; do for CLIENT_DATA_DECLARE_LINE in "${CLIENT_DATA_SYNC[@]}"; do
eval "${CLIENT_DATA_DECLARE_LINE}" eval "${CLIENT_DATA_DECLARE_LINE}"
@@ -92,14 +92,13 @@ for CLIENT_DATA_DECLARE_LINE in "${CLIENT_DATA_SYNC[@]}"; do
# Now, CLIENT_DATA_SYNC_LINE[0] contains the local path and CLIENT_DATA_SYNC_LINE[1] contains the remote path # Now, CLIENT_DATA_SYNC_LINE[0] contains the local path and CLIENT_DATA_SYNC_LINE[1] contains the remote path
if grep -q "localPath=${CLIENT_DATA_SYNC_LINE[0]}" "/${HOME}/.var/app/com.nextcloud.desktopclient.nextcloud/config/Nextcloud/nextcloud.cfg"; then if grep -q "localPath=${CLIENT_DATA_SYNC_LINE[0]}" "/${HOME}/.var/app/com.nextcloud.desktopclient.nextcloud/config/Nextcloud/nextcloud.cfg"; then
echo "Already found configured local folder ${CLIENT_DATA_SYNC_LINE[0]} syncing with ${CLIENT_DATA_SYNC_LINE[1]} . Leaving it unchanged." echo "Already found configured local folder ${CLIENT_DATA_SYNC_LINE[0]} syncing with ${CLIENT_DATA_SYNC_LINE[1]} . Leaving it unchanged."
# _nc_first=0
else else
echo "Setup new sync from remote ${CLIENT_DATA_SYNC_LINE[1]} to local ${CLIENT_DATA_SYNC_LINE[0]}" echo "Setup new sync from remote ${CLIENT_DATA_SYNC_LINE[1]} to local ${CLIENT_DATA_SYNC_LINE[0]}"
# if [ "${_nc_first}" -eq 0 ]; then if [ "${_nc_first}" -eq 0 ]; then
# echo "Due to Bug in Nextcloud Client, more than one synced Folder cannot be setup currently. Maybe in the Future." echo "Due to Bug in Nextcloud Client, more than one synced Folder cannot be setup currently. Maybe in the Future."
# continue continue
# fi fi
# _nc_first=0 _nc_first=0
if [ -d "${CLIENT_DATA_SYNC_LINE[0]}" ]; then if [ -d "${CLIENT_DATA_SYNC_LINE[0]}" ]; then
_nc_bak="${CLIENT_DATA_SYNC_LINE[0]}_$(date '+%Y%m%d%H%M%S').bak" _nc_bak="${CLIENT_DATA_SYNC_LINE[0]}_$(date '+%Y%m%d%H%M%S').bak"
echo "Old unsynced Folder ${CLIENT_DATA_SYNC_LINE[0]} was found, renaming to ${_nc_bak}." echo "Old unsynced Folder ${CLIENT_DATA_SYNC_LINE[0]} was found, renaming to ${_nc_bak}."