diff --git a/.gitignore b/.gitignore index afed073..41621ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.csv +*.kdbx diff --git a/convert_to_csv.sh b/convert_to_csv.sh index 89fba66..c9ede98 100755 --- a/convert_to_csv.sh +++ b/convert_to_csv.sh @@ -31,12 +31,11 @@ if [[ -f "$FINAL_FILE_NAME" ]]; then GPG_FILE_NAME=${GPG_FILE_NAME/\.gpg/} PASSWORD=$($PASS_EXECUTABLE show "$GPG_FILE_NAME" | head -n1) - PASSWORD=${PASSWORD/\"/\\\"} - LOGIN_KEY=$($PASS_EXECUTABLE show "$GPG_FILE_NAME" | awk '/login/ || /ID/ || /email/ {print $2}') + LOGIN_KEY=$($PASS_EXECUTABLE show "$GPG_FILE_NAME" | awk '/^login:|ID:|email:|user:/ {ORS=" ";for(i=2; i<=NF; i++) print $i; exit;}') GPG_FILE_NAME=${GPG_FILE_NAME//\// > } - echo "Processing ${GPG_FILE_NAME}"; + echo "Processing $GPG_FILE_NAME"; echo "$GPG_FILE_NAME$DELIMITER$PASSWORD$DELIMITER$LOGIN_KEY" >> $FINAL_FILE_NAME }; done; unset f;