Compare commits

..

2 Commits

Author SHA1 Message Date
Daniel Pätzold 14b35f8bb8 Fixed Errorlogging and kill firefox after token. 2026-04-23 12:16:32 +02:00
Daniel Pätzold e1dd5cc62a Kwallet: fixed copy kwalletrc 2026-04-23 12:09:15 +02:00
2 changed files with 8 additions and 4 deletions
+3 -3
View File
@@ -102,9 +102,9 @@ fi
rm -f ${WALLETPATH_CFG}/*.*
#Always restore configuration with defaults
cp -f kwalletrc $HOME/.config/
chown $SUDO_USER:$SUDO_USER $HOME/.config/kwalletrc
chmod u=rw,og-rwx $HOME/.config/kwalletrc
cp -f kwalletrc $SUDO_HOME/.config/
chown $SUDO_USER:$SUDO_USER $SUDO_HOME/.config/kwalletrc
chmod u=rw,og-rwx $SUDO_HOME/.config/kwalletrc
#Bind mount secure folder to wallet directory
echo "Mounting secure ${WALLETPATH} to wallet-directory ${WALLETPATH_CFG}"
+5 -1
View File
@@ -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"