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 #
# Contact: q3aql@duck.com #
# License: GPL v2.0 #
# Last-Change: 01-07-20222 #
# Last-Change: 17-07-20222 #
# ###########################################################
VERSION="0.2"
@ -145,21 +145,21 @@ function generate_password() {
else
default_long_password=${size_pass}
fi
count_char_password=1
current_password=""
echo ""
echo "# Generating Random Password"
while [ ${count_char_password} -le ${default_long_password} ] ; do
current_char=$(generate_codes "password")
current_password="${current_password}${current_char}"
count_char_password=$(expr ${count_char_password} + 1)
done
echo ""
echo "# PASSWORD: ${current_password}"
echo ""
if [ "${2}" != "param" ] ; then
echo -n "# Press enter key to continue " ; read enter_continue
fi
fi
count_char_password=1
current_password=""
echo ""
echo "# Generating Random Password"
while [ ${count_char_password} -le ${default_long_password} ] ; do
current_char=$(generate_codes "password")
current_password="${current_password}${current_char}"
count_char_password=$(expr ${count_char_password} + 1)
done
echo ""
echo "# PASSWORD: ${current_password}"
echo ""
if [ "${2}" != "param" ] ; then
echo -n "# Press enter key to continue " ; read enter_continue
fi
}

View File

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

View File

@ -5,7 +5,7 @@
# Author: q3aql #
# Contact: q3aql@duck.com #
# License: GPL v2.0 #
# Last-Change: 01-07-20222 #
# Last-Change: 17-07-20222 #
# #########################################################
VERSION="0.2"
@ -191,21 +191,21 @@ function generate_password() {
else
default_long_password=${size_pass}
fi
count_char_password=1
current_password=""
echo ""
echo "# Generating Random Password"
while [ ${count_char_password} -le ${default_long_password} ] ; do
current_char=$(generate_codes "password")
current_password="${current_password}${current_char}"
count_char_password=$(expr ${count_char_password} + 1)
done
echo ""
echo "# PASSWORD: ${current_password}"
echo ""
if [ "${2}" != "param" ] ; then
echo -n "# Press enter key to continue " ; read enter_continue
fi
fi
count_char_password=1
current_password=""
echo ""
echo "# Generating Random Password"
while [ ${count_char_password} -le ${default_long_password} ] ; do
current_char=$(generate_codes "password")
current_password="${current_password}${current_char}"
count_char_password=$(expr ${count_char_password} + 1)
done
echo ""
echo "# PASSWORD: ${current_password}"
echo ""
if [ "${2}" != "param" ] ; then
echo -n "# Press enter key to continue " ; read enter_continue
fi
}
@ -226,19 +226,19 @@ function generate_password_gui() {
else
default_long_password=${size_pass}
fi
count_char_password=1
current_password=""
echo ""
echo "# Generating Random Password"
while [ ${count_char_password} -le ${default_long_password} ] ; do
current_char=$(generate_codes "password")
current_password="${current_password}${current_char}"
count_char_password=$(expr ${count_char_password} + 1)
done
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 has been copied to ${pwsh_vault_password_copy} $(generate_spaces 20)"
fi
count_char_password=1
current_password=""
echo ""
echo "# Generating Random Password"
while [ ${count_char_password} -le ${default_long_password} ] ; do
current_char=$(generate_codes "password")
current_password="${current_password}${current_char}"
count_char_password=$(expr ${count_char_password} + 1)
done
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 has been copied to ${pwsh_vault_password_copy} $(generate_spaces 20)"
}
function generate_password_menu() {