fix code and add otp support
This commit is contained in:
parent
6027f91c9c
commit
4a01b25867
1 changed files with 15 additions and 3 deletions
|
@ -14,11 +14,23 @@ convert_pass() {
|
||||||
name=$1
|
name=$1
|
||||||
mapfile -t lines < <(pass show "$name")
|
mapfile -t lines < <(pass show "$name")
|
||||||
url=$(basename "$name")
|
url=$(basename "$name")
|
||||||
username=$(echo "${lines[1]}" | sed 's/^.*: //')
|
username=$(basename "$name") # Benutzername ist der Dateiname
|
||||||
password=${lines[0]}
|
password=${lines[0]}
|
||||||
folder=$(dirname "$name")
|
folder=$(dirname "$name")
|
||||||
notes=$(printf "%s\n" "${lines[@]:2}")
|
notes=""
|
||||||
echo "$folder,,login,$url,$notes,,$url,$username,$password," >> "$OUTPUT_FILE"
|
totp=""
|
||||||
|
|
||||||
|
# Notizen und TOTP überprüfen
|
||||||
|
for line in "${lines[@]:1}"; do
|
||||||
|
if [[ $line == otpauth* ]]; then
|
||||||
|
totp=$line
|
||||||
|
else
|
||||||
|
notes+="$line\n"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# CSV-Zeile hinzufügen
|
||||||
|
echo "$folder,,login,$url,$notes,,$folder,$username,$password,$totp" >> "$OUTPUT_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Alle Passwortdateien finden und konvertieren
|
# Alle Passwortdateien finden und konvertieren
|
||||||
|
|
Loading…
Reference in a new issue