Update
Add merge_add_databases.sh script
This commit is contained in:
parent
b85d16eb6b
commit
50827375ac
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
48
merge_all_databases.sh
Executable file
48
merge_all_databases.sh
Executable file
@ -0,0 +1,48 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Read Password
|
||||||
|
echo -n "Password: "
|
||||||
|
read -s PASSWORD
|
||||||
|
echo
|
||||||
|
|
||||||
|
FILES=$(find . -name '*.kdbx' -print)
|
||||||
|
MERGES=$(echo "$FILES" | wc -l)
|
||||||
|
COUNT=0
|
||||||
|
GLOBAL='./Database - global.kdbx';
|
||||||
|
IFS=$'\n'
|
||||||
|
|
||||||
|
MERGES=$((MERGES*2-2))
|
||||||
|
# Merge all to global
|
||||||
|
for FILE in $FILES
|
||||||
|
do
|
||||||
|
if [ "$FILE" != "$GLOBAL" ];
|
||||||
|
then
|
||||||
|
echo "$FILE"
|
||||||
|
echo $PASSWORD | keepassxc-cli merge -q -s "$GLOBAL" "$FILE" 2> /dev/null
|
||||||
|
echo -ne $((++COUNT))"/$MERGES"\\r
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# Merge all from global
|
||||||
|
for FILE in $FILES
|
||||||
|
do
|
||||||
|
if [ "$FILE" != "$GLOBAL" ];
|
||||||
|
then
|
||||||
|
echo "$FILE"
|
||||||
|
echo $PASSWORD | keepassxc-cli merge -q -s "$FILE" "$GLOBAL" 2> /dev/null
|
||||||
|
echo -ne $((++COUNT))"/$MERGES"\\r
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Merge all to all
|
||||||
|
#MERGES=$(($MERGES**2-$MERGES))
|
||||||
|
#for FILE1 in $FILES
|
||||||
|
#do
|
||||||
|
# for FILE2 in $FILES
|
||||||
|
# do
|
||||||
|
# if [ "$FILE1" != "$FILE2" ];
|
||||||
|
# then
|
||||||
|
# echo $PASSWORD | keepassxc-cli merge -q -s "$FILE1" "$FILE2" 2> /dev/null
|
||||||
|
# echo -ne $((++COUNT))"/$MERGES"\\r
|
||||||
|
# fi
|
||||||
|
# done
|
||||||
|
#done
|
||||||
|
echo;
|
Loading…
Reference in New Issue
Block a user