Bugfixes #9

Merged
obel1x merged 11 commits from :main into main 2026-04-25 14:50:39 +02:00
6 changed files with 27 additions and 9 deletions
+7
View File
@@ -103,7 +103,14 @@ rm -f ${WALLETPATH_CFG}/*.*
#Restore initial configuration with defaults and make a backup of the old one #Restore initial configuration with defaults and make a backup of the old one
#Only do this once! #Only do this once!
if [[ ! -f "$SUDO_HOME/.config/kwalletrc" ]]; then
#New install, never create rc file before -> use predefined
cp -f $(dirname "0")/kwalletrc $SUDO_HOME/.config/
chown $SUDO_USER:$SUDO_USER $SUDO_HOME/.config/kwalletrc
chmod u=rw,og-rwx $SUDO_HOME/.config/kwalletrc
fi
if [[ ! -f "$SUDO_HOME/.config/kwalletrc.bak" ]]; then if [[ ! -f "$SUDO_HOME/.config/kwalletrc.bak" ]]; then
# If something else was installed before and no bak is existent, make a bakup and reinstall (could also be the predefined version)
cp $SUDO_HOME/.config/kwalletrc $SUDO_HOME/.config/kwalletrc.bak cp $SUDO_HOME/.config/kwalletrc $SUDO_HOME/.config/kwalletrc.bak
cp -f $(dirname "0")/kwalletrc $SUDO_HOME/.config/ cp -f $(dirname "0")/kwalletrc $SUDO_HOME/.config/
chown $SUDO_USER:$SUDO_USER $SUDO_HOME/.config/kwalletrc chown $SUDO_USER:$SUDO_USER $SUDO_HOME/.config/kwalletrc
@@ -11,6 +11,16 @@ if [ "$EUID" -ne 0 ]; then
exit 1 exit 1
fi fi
TALK_PID=$( pgrep -u $SUDO_USER "Nextcloud Talk" | head -n 1 )
if [[ ! -z ${TALK_PID} ]]; then
echo "Stopping Nextcloud Talk with PID ${TALK_PID}"
kill ${TALK_PID} && sleep 0.5
if [[ $? -ne 0 ]]; then
echo "Service could not be stopped, please check why."
exit 1
fi
fi
FILENAME="Nextcloud.Talk-linux-x64.flatpak" FILENAME="Nextcloud.Talk-linux-x64.flatpak"
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
if [ ${SCRIPTPATH::2} == "//" ]; then if [ ${SCRIPTPATH::2} == "//" ]; then
@@ -8,5 +8,6 @@ fi
# Start Nextcloud Talk in Background # Start Nextcloud Talk in Background
#Current Version of Talk is dumping Core #Current Version of Talk is dumping Core
echo "Starting Nextcloud Talk in Background." echo "Starting Nextcloud Talk in Background."
/usr/bin/setsid /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=electron-wrapper --file-forwarding com.nextcloud.talk --background >${TEMPDIR}/talk.log 2>&1 & /usr/bin/setsid -f /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=electron-wrapper --file-forwarding com.nextcloud.talk --background >${TEMPDIR}/talk.log 2>&1
sleep 5
exit 0
+2
View File
@@ -40,3 +40,5 @@ done
echo "Completed user scripts in software." echo "Completed user scripts in software."
cd ${SCRIPTPATH} cd ${SCRIPTPATH}
exit 0
+3
View File
@@ -53,6 +53,9 @@ elog_add "Successfully obtained Token for User ${DAVTOKEN_USER}"
elog_add "" elog_add ""
elog_add "Update and install client software" elog_add "Update and install client software"
#Set global to enable git
git config --global --add safe.directory /opt/sys_config
# First, check the sudo rule # First, check the sudo rule
elog_add "Check the matching client rule:" elog_add "Check the matching client rule:"
#Somewhat strange "sudo -l" will *sometimes* ask for password instead of just checking if the rule can be found, so it needs -n to be silent #Somewhat strange "sudo -l" will *sometimes* ask for password instead of just checking if the rule can be found, so it needs -n to be silent
+2 -7
View File
@@ -30,7 +30,6 @@ chmod ug+rwX,o=rX -R ${SYSCONFIGPATH}
#Do an upgrade of the Base package if its configured and if there are changes #Do an upgrade of the Base package if its configured and if there are changes
if [[ ! -z "${UPGRADEURL}" ]]; then if [[ ! -z "${UPGRADEURL}" ]]; then
echo "===================="
echo "Checking for Upgrades on ${UPGRADEURL} and Branch ${UPGRADEBRANCH}" echo "Checking for Upgrades on ${UPGRADEURL} and Branch ${UPGRADEBRANCH}"
REMOTEURL=$( git config --get remote.origin.url ) REMOTEURL=$( git config --get remote.origin.url )
echo "Remote git URL is ${REMOTEURL}" echo "Remote git URL is ${REMOTEURL}"
@@ -55,13 +54,11 @@ fi
# At first, sync central configs if they are configured to be synced # At first, sync central configs if they are configured to be synced
if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then
echo "===================="
echo "Synced config path was found, doing remote sync." echo "Synced config path was found, doing remote sync."
SYNCCMD="sudo -i /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloudcmd com.nextcloud.desktopclient.nextcloud -h -u ${DAVTOKEN_USER} -p ${DAVTOKEN_PASS} --path ${DISTCONFIGPATH_SRC} ${DISTCONFIGPATH} https://${SERVERFQDN_NC}" SYNCCMD="sudo -i /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloudcmd com.nextcloud.desktopclient.nextcloud -h -u ${DAVTOKEN_USER} -p ${DAVTOKEN_PASS} --path ${DISTCONFIGPATH_SRC} ${DISTCONFIGPATH} https://${SERVERFQDN_NC}"
SYNCCMD_HIDDENPW=$( echo "${SYNCCMD/${DAVTOKEN_PASS}/***HIDDEN***}" ) SYNCCMD_HIDDENPW=$( echo "${SYNCCMD/${DAVTOKEN_PASS}/***HIDDEN***}" )
echo "Exec: ${SYNCCMD_HIDDENPW}" echo "Exec: ${SYNCCMD_HIDDENPW}"
echo "Sync Configuration" echo "Sync Configuration"
echo ""
${SYNCCMD} >${TEMPDIR}/synccmd_last.log 2>&1 ${SYNCCMD} >${TEMPDIR}/synccmd_last.log 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo "Error in sync:" echo "Error in sync:"
@@ -77,7 +74,6 @@ if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then
echo "" echo ""
fi fi
#Check if Repository is defined #Check if Repository is defined
echo "===================="
if [ "${CLIENT_SOFTWARE_DST}." == "." ]; then if [ "${CLIENT_SOFTWARE_DST}." == "." ]; then
echo "No central softwarerepository defined (CLIENT_SOFTWARE_DST). Skipping sync." echo "No central softwarerepository defined (CLIENT_SOFTWARE_DST). Skipping sync."
else else
@@ -90,8 +86,6 @@ else
SYNCCMD_HIDDENPW=$( echo "${SYNCCMD/${DAVTOKEN_PASS}/***HIDDEN***}" ) SYNCCMD_HIDDENPW=$( echo "${SYNCCMD/${DAVTOKEN_PASS}/***HIDDEN***}" )
echo "Exec: ${SYNCCMD_HIDDENPW}" echo "Exec: ${SYNCCMD_HIDDENPW}"
echo "Sync Client Software" echo "Sync Client Software"
echo "===================="
echo ""
${SYNCCMD} >${TEMPDIR}/synccmd_last.log 2>&1 ${SYNCCMD} >${TEMPDIR}/synccmd_last.log 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo "Error in sync:" echo "Error in sync:"
@@ -121,5 +115,6 @@ else
exit 1 exit 1
fi fi
fi fi
echo ""
fi fi
echo ""
exit 0