forked from obel1x/fedora-OEMDRV
KWallet: No Migration of old Wallet, instead use predefined ones
This commit is contained in:
@@ -35,9 +35,6 @@ WALLETFILE="${WALLETNAME}.kwl"
|
|||||||
WALLETPATH="${DECRYPTEDDATADIR}/kwallet"
|
WALLETPATH="${DECRYPTEDDATADIR}/kwallet"
|
||||||
WALLETPATH_CFG="$SUDO_HOME/.local/share/kwalletd"
|
WALLETPATH_CFG="$SUDO_HOME/.local/share/kwalletd"
|
||||||
|
|
||||||
# At the start of this script, the local wallet-directory should be empty and the encrpted directory should be mount to that path
|
|
||||||
# if thats not the case, will will move the files an configure them
|
|
||||||
|
|
||||||
# Stop the daemon anyway if running
|
# Stop the daemon anyway if running
|
||||||
WALLET_PID=$( pgrep -u $USER kwalletd6 )
|
WALLET_PID=$( pgrep -u $USER kwalletd6 )
|
||||||
if [[ ! -z ${WALLET_PID} ]]; then
|
if [[ ! -z ${WALLET_PID} ]]; then
|
||||||
@@ -50,23 +47,19 @@ fi
|
|||||||
|
|
||||||
#Setup encrypted path if not existing already
|
#Setup encrypted path if not existing already
|
||||||
mkdir -p ${WALLETPATH}
|
mkdir -p ${WALLETPATH}
|
||||||
|
#Check, if wallet ist already setup in encryted dir. If not, copy our empty deafult wallets to it
|
||||||
|
if [ -f "${WALLETPATH}/${WALLETNAME}.kwl" ]; then
|
||||||
|
cp ${WALLETNAME}*.* ${WALLETPATH}
|
||||||
|
fi
|
||||||
chown $SUDO_USER:$SUDO_USER ${WALLETPATH} -R
|
chown $SUDO_USER:$SUDO_USER ${WALLETPATH} -R
|
||||||
chmod u=rwX,og-rwx ${WALLETPATH} -R
|
chmod u=rwX,og-rwx ${WALLETPATH} -R
|
||||||
|
|
||||||
#Check for existing legacy wallets: should be empty. Otherwise: move them.
|
#Unmount to have free vision to Directory
|
||||||
umount ${WALLETPATH_CFG} >/dev/null 2>&1
|
umount ${WALLETPATH_CFG} >/dev/null 2>&1
|
||||||
PATTERN=(${WALLETPATH_CFG}/*.kwl)
|
|
||||||
if [ -f ${PATTERN[0]} ]; then
|
#With every new start of KDE the Files will be recreated in ${WALLETPATH_CFG} containing no passwords but enrcypted with current user Password.
|
||||||
echo "Moving to ${WALLETPATH}, Files: ${PATTERN}"
|
#We cannot use this wallet, so drop it
|
||||||
mv ${WALLETPATH_CFG}/*.* ${WALLETPATH}
|
rm -f ${WALLETPATH_CFG}/*.*
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
echo "Legacy wallets could not be moved, please do that manually:"
|
|
||||||
echo "Move ${WALLETPATH_CFG}/*.kwl to ${WALLETPATH}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Found no legacy Files in ${WALLETPATH_CFG}, no migration needed."
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Always restore configuration with defaults
|
#Always restore configuration with defaults
|
||||||
cp -f kwalletrc $HOME/.config/
|
cp -f kwalletrc $HOME/.config/
|
||||||
|
|||||||
Reference in New Issue
Block a user