From 1cee4f82f4a4c13fe198e65c0acc239f7a887bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=C3=A4tzold?= Date: Tue, 7 Apr 2026 15:06:57 +0200 Subject: [PATCH] Kwallet: Split User_Run from install --- client_software/0010_kwallet/install.sh | 25 -------------------- client_software/0010_kwallet/user_run.sh | 30 ++++++++++++++++++++++++ system_setup/mount_ecrypt_home.sh | 2 +- 3 files changed, 31 insertions(+), 26 deletions(-) create mode 100755 client_software/0010_kwallet/user_run.sh diff --git a/client_software/0010_kwallet/install.sh b/client_software/0010_kwallet/install.sh index 19fbb95..ad17fe6 100755 --- a/client_software/0010_kwallet/install.sh +++ b/client_software/0010_kwallet/install.sh @@ -29,8 +29,6 @@ if [ "${DAVTOKEN_USER}." == "." ]; then fi #Local Vars -#SYNCCMD="$BASECMD --userid ${DAVTOKEN_USER} --apppassword ${DAVTOKEN_PASS} --localdirpath ${CLIENT_DATA_DST} --remotedirpath ${CLIENT_DATA_SRC} --serverurl https://${SERVERFQDN_NC}" -#SYNCCMD_HIDDENPW=$( echo "${SYNCCMD/${DAVTOKEN_PASS}/***HIDDEN***}" ) WALLETNAME="kdewallet" WALLETFILE="${WALLETNAME}.kwl" WALLETPATH="${DECRYPTEDDATADIR}/kwallet" @@ -110,27 +108,4 @@ if [[ $? -ne 0 ]]; then exit 1 fi -#Restart the service -su -c 'nohup kwalletd6 >/dev/null 2>&1 &' $SUDO_USER -sleep 2 - -#Check if kwalletd is enabled now -QB_RESULT=$( su -c "$(dirname $0)/qbus_wallet_exec.sh isEnabled 2>/dev/null || true" $SUDO_USER ) -if [[ "$QB_RESULT" != "true" ]]; then - echo "Error checking if kWallet service is activated. Cannot continue. Return of Check was:" - echo "$QB_RESULT" - exit 1 -fi - -#It should be possible to open the wallet without having to enter the password now. -echo "Checking if Wallet can be opened by the user. The Program should not ask for a password, maybe for confirmation to access the wallet which is ok." -echo "Please check to NOT have any Password asked now - if so, open kwalletmanager and change the password for wallet ${WALLETNAME} to nothing (by entering nothing when asked for new password)!" -WALLETAPPID="sys_config_wallet_script" -QB_RESULT=$( su -c "$(dirname $0)/qbus_wallet_exec.sh open ${WALLETNAME} 0 $WALLETAPPID" $SUDO_USER ) -if [[ $? -ne 0 ]]; then - echo "Some Error opening Wallet ${WALLETNAME}. Please check." - exit 1 -fi -echo "Sucessfully opened Wallet ${WALLETNAME} with ID ${QB_RESULT}." - exit 0 diff --git a/client_software/0010_kwallet/user_run.sh b/client_software/0010_kwallet/user_run.sh new file mode 100755 index 0000000..e8444a9 --- /dev/null +++ b/client_software/0010_kwallet/user_run.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Restart and test Kwallet- Service + +# Vars +WALLETAPPID="sys_config_wallet_script" +WALLETNAME="kdewallet" + +#Restart the service +nohup kwalletd6 >/dev/null 2>&1 & +sleep 1 + +#Check if kwalletd is enabled now +QB_RESULT=$( $(dirname $0)/qbus_wallet_exec.sh isEnabled 2>/dev/null || true ) +if [[ "$QB_RESULT" != "true" ]]; then + echo "Error checking if kWallet service is activated. Cannot continue. Return of Check was:" + echo "$QB_RESULT" + exit 1 +fi + +#It should be possible to open the wallet without having to enter the password now. +echo "Checking if Wallet can be opened by the user. The Program should not ask for a password, maybe for confirmation to access the wallet which is ok." +echo "Please check to NOT have any Password asked now - if so, open kwalletmanager and change the password for wallet ${WALLETNAME} to nothing (by entering nothing when asked for new password)!" +QB_RESULT=$( $(dirname $0)/qbus_wallet_exec.sh open ${WALLETNAME} 0 $WALLETAPPID ) +if [[ $? -ne 0 ]]; then + echo "Some Error opening Wallet ${WALLETNAME}. Please check." + exit 1 +fi +echo "Sucessfully opened Wallet ${WALLETNAME} with ID ${QB_RESULT}." + +exit 0 diff --git a/system_setup/mount_ecrypt_home.sh b/system_setup/mount_ecrypt_home.sh index bbaa507..aca9171 100755 --- a/system_setup/mount_ecrypt_home.sh +++ b/system_setup/mount_ecrypt_home.sh @@ -7,7 +7,7 @@ # If no IPA-Server is available (e.g. if no internet is available) it will Prompt the User to Enter the Key manually. ATTENTION: The Key MUST NOT BE STORED plaintext on this PC, this would be very insecure! # If no encryption has been setup so far, it will create a new wallet and Store the Encryption to the IPA Vault. -source $(dirname "$0")/setup_system.inc.sh +#source $(dirname "$0")/setup_system.inc.sh EXECDIR=$(pwd) #Check if Directory is alread mounted