X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=enc.sh;h=c399a7e9edeb635470e35b9e07eef22b9227b5f7;hb=2e06e7046ed02d83847d61a6a135296a186eba03;hp=e6c51ebef1390edb05f5bf6cc569d782bad10379;hpb=0b2f05222a6101e555151c5751c3b5ec03eb51bb;p=cmccabe-bin diff --git a/enc.sh b/enc.sh index e6c51eb..c399a7e 100755 --- a/enc.sh +++ b/enc.sh @@ -5,10 +5,16 @@ die() { exit 1 } +if [[ "x${PASS}" = "x" ]]; then + read -s -p "enter password: " PASS + echo + read -s -p "re-enter password: " PASS2 + [[ ${PASS} == ${PASS2} ]] || die "The passwords did not match." +fi + #[ "x${SALT}" = "x" ] && die "you must set SALT to the salt." #SALT=$(dd count=1024 if=/dev/random 2>/dev/null |md5sum|sed 's/-//') #[ $? -ne 0 ] && die "failed to generate SALT" -[ "x${PASS}" = "x" ] && die "you must set PASS to the password" RET=0 for FILE in "$@"; do