From fd3ab78f92bba5f603ea21227f8c230e488373a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=C3=A4tzold?= Date: Thu, 23 Apr 2026 13:43:50 +0200 Subject: [PATCH] Changed Order of Nextcloud and Mozilla_pre --- .../firefox.tar.zst | Bin .../profiles_ff.ini | 0 .../thunderbird.tar.zst | Bin .../user_run.sh | 0 .../user_run.sh | 20 ++++++++++++++---- 5 files changed, 16 insertions(+), 4 deletions(-) rename client_software/{0050_nextcloud_mozilla_pre => 0020_nextcloud_mozilla_pre}/firefox.tar.zst (100%) rename client_software/{0050_nextcloud_mozilla_pre => 0020_nextcloud_mozilla_pre}/profiles_ff.ini (100%) rename client_software/{0050_nextcloud_mozilla_pre => 0020_nextcloud_mozilla_pre}/thunderbird.tar.zst (100%) rename client_software/{0050_nextcloud_mozilla_pre => 0020_nextcloud_mozilla_pre}/user_run.sh (100%) rename client_software/{0020_nextcloud_desktopclient => 0050_nextcloud_desktopclient}/user_run.sh (92%) diff --git a/client_software/0050_nextcloud_mozilla_pre/firefox.tar.zst b/client_software/0020_nextcloud_mozilla_pre/firefox.tar.zst similarity index 100% rename from client_software/0050_nextcloud_mozilla_pre/firefox.tar.zst rename to client_software/0020_nextcloud_mozilla_pre/firefox.tar.zst diff --git a/client_software/0050_nextcloud_mozilla_pre/profiles_ff.ini b/client_software/0020_nextcloud_mozilla_pre/profiles_ff.ini similarity index 100% rename from client_software/0050_nextcloud_mozilla_pre/profiles_ff.ini rename to client_software/0020_nextcloud_mozilla_pre/profiles_ff.ini diff --git a/client_software/0050_nextcloud_mozilla_pre/thunderbird.tar.zst b/client_software/0020_nextcloud_mozilla_pre/thunderbird.tar.zst similarity index 100% rename from client_software/0050_nextcloud_mozilla_pre/thunderbird.tar.zst rename to client_software/0020_nextcloud_mozilla_pre/thunderbird.tar.zst diff --git a/client_software/0050_nextcloud_mozilla_pre/user_run.sh b/client_software/0020_nextcloud_mozilla_pre/user_run.sh similarity index 100% rename from client_software/0050_nextcloud_mozilla_pre/user_run.sh rename to client_software/0020_nextcloud_mozilla_pre/user_run.sh diff --git a/client_software/0020_nextcloud_desktopclient/user_run.sh b/client_software/0050_nextcloud_desktopclient/user_run.sh similarity index 92% rename from client_software/0020_nextcloud_desktopclient/user_run.sh rename to client_software/0050_nextcloud_desktopclient/user_run.sh index 47855b4..d822e8f 100755 --- a/client_software/0020_nextcloud_desktopclient/user_run.sh +++ b/client_software/0050_nextcloud_desktopclient/user_run.sh @@ -26,15 +26,26 @@ fi NC_PID=$( pgrep -u $USER nextcloud ) if [[ ! -z ${NC_PID} ]]; then echo "Stopping Nextcloud with PID ${NC_PID}" - # Kill does not remove lockfiles in ~/.var/app/com.nextcloud.desktopclient.nextcloud/cache/tmp/ which will prevent next start - # kill ${NC_PID} && sleep 2 - /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloud com.nextcloud.desktopclient.nextcloud --quit >/dev/null && sleep 2 + /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloud com.nextcloud.desktopclient.nextcloud --quit >/dev/null if [[ $? -ne 0 ]]; then echo "Service could not be stopped, please check why." exit 1 fi + sleep 0.5 +fi + +NC_PID=$( pgrep -u $USER nextcloud ) +if [[ ! -z ${NC_PID} ]]; then + echo "Nextcloud still running with PID ${NC_PID}. Force stop" + # Kill does not remove lockfiles in ~/.var/app/com.nextcloud.desktopclient.nextcloud/cache/tmp/ which will prevent next start + kill ${NC_PID} + if [[ $? -ne 0 ]]; then + echo "Service could not be stopped, please check why." + exit 1 + fi + sleep 0.5 + rm -rif ${HOME}/.var/app/com.nextcloud.desktopclient.nextcloud/cache/temp/* fi -sleep 0.5 #Check if Option is Configured to use Nextcloud Desktop Data- Sync declare -p CLIENT_DATA_SYNC_DECLARE >/dev/null @@ -73,6 +84,7 @@ for i in {0..99}; do echo "Exec: ${SYNCCMD_HIDDENPW}" # Due to Bugs in Nextcloud, autoprovisioning will only work when no configuration is existent. Therefore delete any exitsing configs that may be there rm -rif ${HOME}/.var/app/com.nextcloud.desktopclient.nextcloud/data/Nextcloud + rm -rif ${HOME}/.var/app/com.nextcloud.desktopclient.nextcloud/config/Nextcloud #Now, execute Nextcloud autoprovisionig ${SYNCCMD} if [ $? -ne 0 ]; then