Fix password generation with empty value

This commit is contained in:
q3aql 2022-07-17 14:11:49 +02:00
parent 4e23de6712
commit 69983554a7
3 changed files with 68 additions and 68 deletions

View File

@ -5,7 +5,7 @@
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
# License: GPL v2.0 # # License: GPL v2.0 #
# Last-Change: 01-07-20222 # # Last-Change: 17-07-20222 #
# ########################################################### # ###########################################################
VERSION="0.2" VERSION="0.2"
@ -145,6 +145,7 @@ function generate_password() {
else else
default_long_password=${size_pass} default_long_password=${size_pass}
fi fi
fi
count_char_password=1 count_char_password=1
current_password="" current_password=""
echo "" echo ""
@ -160,7 +161,6 @@ function generate_password() {
if [ "${2}" != "param" ] ; then if [ "${2}" != "param" ] ; then
echo -n "# Press enter key to continue " ; read enter_continue echo -n "# Press enter key to continue " ; read enter_continue
fi fi
fi
} }
function generate_password_menu() { function generate_password_menu() {

View File

@ -5,7 +5,7 @@
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
# License: GPL v2.0 # # License: GPL v2.0 #
# Last-Change: 01-07-20222 # # Last-Change: 17-07-20222 #
# ############################################################# # #############################################################
VERSION="0.2" VERSION="0.2"
@ -156,6 +156,7 @@ function generate_password() {
else else
default_long_password=${size_pass} default_long_password=${size_pass}
fi fi
fi
count_char_password=1 count_char_password=1
current_password="" current_password=""
echo "" echo ""
@ -171,7 +172,6 @@ function generate_password() {
if [ "${2}" != "param" ] ; then if [ "${2}" != "param" ] ; then
echo -n "# Press enter key to continue " ; read enter_continue echo -n "# Press enter key to continue " ; read enter_continue
fi fi
fi
} }
function gen_password_dl() { function gen_password_dl() {
@ -191,6 +191,7 @@ function gen_password_dl() {
else else
default_long_password=${size_pass} default_long_password=${size_pass}
fi fi
fi
count_char_password=1 count_char_password=1
current_password="" current_password=""
while [ ${count_char_password} -le ${default_long_password} ] ; do while [ ${count_char_password} -le ${default_long_password} ] ; do
@ -199,7 +200,6 @@ function gen_password_dl() {
count_char_password=$(expr ${count_char_password} + 1) count_char_password=$(expr ${count_char_password} + 1)
done done
echo "${current_password}" echo "${current_password}"
fi
} }
function generate_password_menu() { function generate_password_menu() {

View File

@ -5,7 +5,7 @@
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
# License: GPL v2.0 # # License: GPL v2.0 #
# Last-Change: 01-07-20222 # # Last-Change: 17-07-20222 #
# ######################################################### # #########################################################
VERSION="0.2" VERSION="0.2"
@ -191,6 +191,7 @@ function generate_password() {
else else
default_long_password=${size_pass} default_long_password=${size_pass}
fi fi
fi
count_char_password=1 count_char_password=1
current_password="" current_password=""
echo "" echo ""
@ -206,7 +207,6 @@ function generate_password() {
if [ "${2}" != "param" ] ; then if [ "${2}" != "param" ] ; then
echo -n "# Press enter key to continue " ; read enter_continue echo -n "# Press enter key to continue " ; read enter_continue
fi fi
fi
} }
function generate_password_gui() { function generate_password_gui() {
@ -226,6 +226,7 @@ function generate_password_gui() {
else else
default_long_password=${size_pass} default_long_password=${size_pass}
fi fi
fi
count_char_password=1 count_char_password=1
current_password="" current_password=""
echo "" echo ""
@ -238,7 +239,6 @@ function generate_password_gui() {
echo ${current_password} >> ${pwsh_vault_password_copy} echo ${current_password} >> ${pwsh_vault_password_copy}
echo > /dev/null | pwsh-vaultm -p " PASSWORD: ${current_password} $(generate_spaces 65)" echo > /dev/null | pwsh-vaultm -p " PASSWORD: ${current_password} $(generate_spaces 65)"
echo > /dev/null | pwsh-vaultm -p " Password has been copied to ${pwsh_vault_password_copy} $(generate_spaces 20)" echo > /dev/null | pwsh-vaultm -p " Password has been copied to ${pwsh_vault_password_copy} $(generate_spaces 20)"
fi
} }
function generate_password_menu() { function generate_password_menu() {