vim, gitconfig, update.sh
[dotfiles_afify.git] / .scripts / gen_pass.sh
blob0b75ea704a5384da88cffd617c54437e72d334fa
1 #!/bin/sh
3 change(){
4 pass_dir="$HOME/.password-store"
5 backup_dir="$HOME/pass_bk"
6 [ -d "$backup_dir" ] || mkdir "$backup_dir"
7 all=$(find "$pass_dir" -type f -iname "*.gpg" -printf '%f\n' | sed -n 's/\.gpg$//p')
8 all_url=$(echo "$all" | awk -F: '{print $1}')
10 for i in $all; do
11 pass "$i" >> "$backup_dir/$i.txt"
12 pass generate -f "$i" 25
13 done
15 firefox $all_url
18 case $1 in
19 reg) pass generate --no-symbols -f "$2" 20;;
20 change) change;;
21 *) echo "(reg | change)"
22 esac