pm

barebones password manager
git clone git://git.ckyln.com/~cem/pm.git
Log | Files | Refs | README

pm-ask (283B)


      1 #!/bin/sh
      2 [ "$1" ] || exit 1
      3 stty -echo
      4 printf 'Enter your password for %s: ' "$1"
      5 read pass
      6 printf '\nEnter your password again: '
      7 read pass2
      8 printf '\n'
      9 stty echo
     10 [ "$pass" = "$pass2" ] && { printf '%s' "$pass" | pm a "$1" ;} || {
     11     printf "Passwords don't match\n"
     12     exit 1
     13 }