diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..37e21a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +pwd.sh.safe diff --git a/pwd.sh b/pwd.sh index a11c9fb..6ca90a8 100755 --- a/pwd.sh +++ b/pwd.sh @@ -160,8 +160,13 @@ sanity_check () { sanity_check -read -n 1 -p "Read, write, or delete password? (r/w/d, default: r) " action -printf "\n" +if [ -z ${1+x} ] +then + read -n 1 -p "Read, write, or delete password? (r/w/d, default: r) " action + printf "\n" +else + action="$1" +fi if [[ "${action}" =~ ^([wW])$ ]] ; then create_username && write_pass