save
This commit is contained in:
parent
7360824eab
commit
368ebfaba2
6 changed files with 147 additions and 0 deletions
28
bin/apas
Executable file
28
bin/apas
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
function lhash {
|
||||
echo -n "${1}" | openssl dgst -sha512 | cut -d' ' -f2 | openssl dgst -md5 | cut -d' ' -f2
|
||||
}
|
||||
|
||||
# Prompt user for input
|
||||
read -p "Website: " url
|
||||
read -p "Login: " login
|
||||
read -s -p "Password: " password
|
||||
echo
|
||||
|
||||
domain=$(echo "$url" | sed -E 's~https?://([^/]+).*~\1~')
|
||||
hash=$(lhash "$login")
|
||||
pass_path="web/${domain}/${hash}"
|
||||
|
||||
# Entry content
|
||||
entry="${password}
|
||||
url: ${url}
|
||||
login: ${login}
|
||||
"
|
||||
|
||||
echo "$entry" | pass insert -m "$pass_path"
|
||||
|
||||
# url
|
||||
# login
|
||||
# tags
|
||||
# note
|
Loading…
Add table
Add a link
Reference in a new issue