mirror of
https://github.com/octoleo/Purse.git
synced 2024-12-29 12:32:39 +00:00
User can enter upper or lowercase on y/n|r/w/d prompt
This commit is contained in:
parent
46cdfd3578
commit
fa2431f54e
6
pwd.sh
6
pwd.sh
@ -137,7 +137,7 @@ create_username () {
|
|||||||
read -p "
|
read -p "
|
||||||
Generate password? (y/n, default: y) " rand_pass
|
Generate password? (y/n, default: y) " rand_pass
|
||||||
|
|
||||||
if [ "${rand_pass}" == "n" ]; then
|
if [[ "${rand_pass}" =~ ^([nN][oO]|[nN])$ ]]; then
|
||||||
get_pass "
|
get_pass "
|
||||||
Enter password for \"${username}\": " ; echo
|
Enter password for \"${username}\": " ; echo
|
||||||
userpass=$password
|
userpass=$password
|
||||||
@ -163,9 +163,9 @@ sanity_check
|
|||||||
read -n 1 -p "Read, write, or delete password? (r/w/d, default: r) " action
|
read -n 1 -p "Read, write, or delete password? (r/w/d, default: r) " action
|
||||||
printf "\n"
|
printf "\n"
|
||||||
|
|
||||||
if [ "${action}" == "w" ] ; then
|
if [[ "${action}" =~ ^([wW])$ ]] ; then
|
||||||
create_username && write_pass
|
create_username && write_pass
|
||||||
elif [ "${action}" == "d" ] ; then
|
elif [[ "${action}" =~ ^([dD])$ ]] ; then
|
||||||
read -p "
|
read -p "
|
||||||
Username to delete? " username && write_pass
|
Username to delete? " username && write_pass
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user