From d482c47b85abffe327f3c4e3533fa870839c9ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=C3=A4tzold?= Date: Wed, 1 Apr 2026 17:15:12 +0200 Subject: [PATCH] Talk: Remove old userspace and new user_run script --- .../0110_nextcloud_talk_app/user_run.sh | 8 +++- client_software/user_run.sh | 42 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100755 client_software/user_run.sh diff --git a/client_software/0110_nextcloud_talk_app/user_run.sh b/client_software/0110_nextcloud_talk_app/user_run.sh index 346b611..0211c5d 100755 --- a/client_software/0110_nextcloud_talk_app/user_run.sh +++ b/client_software/0110_nextcloud_talk_app/user_run.sh @@ -1,3 +1,9 @@ #!/bin/bash +#Deinstall wrong installed userspace app +/usr/bin/flatpak list --user | grep com.nextcloud.talk +if [[ $? -eq 0 ]]; then + /usr/bin/flatpak uninstall -y --user com.nextcloud.talk +fi + # Start Nextcloud Talk in Background -/usr/bin/nohup flatpak run --branch=stable --arch=x86_64 --command=electron-wrapper --file-forwarding com.nextcloud.talk --background 1>/dev/null 2>&1 & +/usr/bin/nohup /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=electron-wrapper --file-forwarding com.nextcloud.talk --background 1>/dev/null 2>&1 & diff --git a/client_software/user_run.sh b/client_software/user_run.sh new file mode 100755 index 0000000..6228f0a --- /dev/null +++ b/client_software/user_run.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env sh +# SPDX-FileCopyrightText: Daniel Pätzold +# SPDX-License-Identifier: AGPL-3.0-or-later +# +# Running user scripts after install (as user, not root) +# If P1 is given, only scripts will be executed, that are containing the P1 string in their dirname +# + +#Check Token +if [ "${DAVTOKEN_USER}." == "." ]; then + echo "Error: Script cannot be executed standalone and needs a prereserved environement from logon-script." + echo "Press any key to continue" && read -n 1 -s -r && exit 1 +fi + +echo "Running user scripts in software." +for DIR in $(ls -d ${CLIENT_SOFTWARE_DST}/*/ | sort); # list directories in the form "/tmp/dirname/" +do + DIR=${DIR%*/} # remove the trailing "/" + if [[ "$1." != "." ]] && [[ "${DIR}" != *"$1"* ]]; then + #search for string in dir + echo "Skipping ${DIR} while not in search parameter ( $1 )." + continue + fi + if [ -f "${DIR}/user_run.sh" ]; then + echo "*** ==================== ***" + echo "*** Running ${DIR##*/} ***" # print everything after the final "/" + cd ${DIR} + ${DIR}/user_run.sh + if [ $? -ne 0 ]; then + echo "*** ==================== ***" + echo "Some Error in script, will not continue. Please check." + echo "Press any key to continue." + read -n 1 -s -r + cd ${SCRIPTPATH} + exit 1 + fi + echo "*** ==================== ***" + fi +done +echo "Completed user scripts in software." + +cd ${SCRIPTPATH}