We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06a43ca commit 0eb4410Copy full SHA for 0eb4410
func/main.sh
@@ -165,19 +165,14 @@ get_user_owner() {
165
# Random password generator
166
generate_password() {
167
matrix=$1
168
- lenght=$2
+ length=$2
169
if [ -z "$matrix" ]; then
170
- matrix=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+ matrix=[:alnum:]
171
fi
172
- if [ -z "$lenght" ]; then
173
- lenght=10
+ if [ -z "$length" ]; then
+ length=10
174
175
- i=1
176
- while [ $i -le $lenght ]; do
177
- pass="$pass${matrix:$(($RANDOM%${#matrix})):1}"
178
- ((i++))
179
- done
180
- echo "$pass"
+ cat /dev/urandom | tr -dc $matrix | head -c$lenght
181
}
182
183
# Package existence check
0 commit comments