Files
fedora-OEMDRV/client_software/0110_nextcloud_talk_app/install.sh
T
2026-03-31 23:16:51 +02:00

38 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env sh
# SPDX-FileCopyrightText: Daniel Pätzold
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# Sofwareinstallation script for Nextcloud Talk.
#
#Check for root
if [ "$EUID" -ne 0 ]; then
echo "Error: Script requires root. Please check if ${SCRIPTPATH}/${SCRIPTNAME} is in sudoers rules and if you are a member. And if executed via sudo."
exit 1
fi
FILENAME="Nextcloud.Talk-linux-x64.flatpak"
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
if [ ${SCRIPTPATH::2} == "//" ]; then
SCRIPTPATH=${SCRIPTPATH:1}
fi
echo "Getting new Version online and saving File to ${SCRIPTPATH}/${FILENAME}"
wget -q -P ${SCRIPTPATH} --timestamping https://github.com/nextcloud-releases/talk-desktop/releases/latest/download/${FILENAME}
# Not needed: Package has no Version, but internal Commit should be automagically detected, see "flatpak list -d"
#INSTINFO=$( /usr/bin/flatpak list --columns=app,version | grep com.nextcloud.talk )
#Hint: If this fails, try to remove and Download the File again
# Install or update Talk - always in Superuser- Mode
# As User you may install Talk in userspace (with -u), but you cannot update the runtime org.freedesktop.Platform/x86_64/XX.YY
# So it does not make any sense to install as user
/usr/bin/flatpak install -y --or-update --noninteractive --bundle ${SCRIPTPATH}/${FILENAME} && echo Done Install of ${FILENAME}
#TODO: Check if Talk is installed - if not, exit 1
#Always start App
su -c "nohup /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=electron-wrapper --file-forwarding com.nextcloud.talk --background >/dev/null 2>&1 &" $SUDO_USER
exit 0