From 14b35f8bb8e0822fb25444a441e63df1cdab6006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=C3=A4tzold?= Date: Thu, 23 Apr 2026 12:16:32 +0200 Subject: [PATCH] Fixed Errorlogging and kill firefox after token. --- system_setup/setup_system.inc.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system_setup/setup_system.inc.sh b/system_setup/setup_system.inc.sh index d761bb3..f90ca51 100755 --- a/system_setup/setup_system.inc.sh +++ b/system_setup/setup_system.inc.sh @@ -44,7 +44,7 @@ elog_add_command() { #Run a command, capture output (STD and ERR) to the logfile AND output to screen # WILL NOT SET RETTXT to make Output directly to screen #Returns the exit value of the command in $? and in RETNO - $@ | tee -a ${LOGFILE} + $@ 2>&1 | tee -a ${LOGFILE} RETNO=$? return ${RETNO} } @@ -78,6 +78,9 @@ get_nc_token() { fi if [ ! -f ${DAVTOKENFILENAME} ]; then + echo "No token found here. Getting a new WEBDAV Token for this Device." + echo "Please logon to your Nextcloud instance via SSO/kerberos" + # Directory is ok, but no Tokenfile was found, need to generate a new one REQJSON=$( curl -s -A "WEBDAV:${HOSTNM}" -X POST "https://${SERVERFQDN_NC}/index.php/login/v2" ) # echo "JSON is:" @@ -96,6 +99,7 @@ get_nc_token() { if [[ "${POLLJSON}" == *"appPassword"* ]]; then echo "${POLLJSON}" > ${DAVTOKENFILENAME} echo "found token. Token has been written to ${DAVTOKENFILENAME}" + pkill firefox break else echo "failed"