Fix problem with some passwords and login names

This commit is contained in:
Claudio Maradonna 2021-06-02 19:35:34 +02:00
parent c984e72901
commit 82557b7196
Signed by: claudiomaradonna
GPG key ID: B1EDCB4C3B05C387
2 changed files with 3 additions and 3 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
*.csv *.csv
*.kdbx

View file

@ -31,12 +31,11 @@ if [[ -f "$FINAL_FILE_NAME" ]]; then
GPG_FILE_NAME=${GPG_FILE_NAME/\.gpg/} GPG_FILE_NAME=${GPG_FILE_NAME/\.gpg/}
PASSWORD=$($PASS_EXECUTABLE show "$GPG_FILE_NAME" | head -n1) 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//\// > } 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 echo "$GPG_FILE_NAME$DELIMITER$PASSWORD$DELIMITER$LOGIN_KEY" >> $FINAL_FILE_NAME
}; done; }; done;
unset f; unset f;