Fix secret length generation
This commit is contained in:
parent
2d6a08a671
commit
1b85bf3d37
24
abra
24
abra
@ -1633,9 +1633,9 @@ POWERED BY
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub_app_secret_generate(){
|
sub_app_secret_generate(){
|
||||||
SECRET="$abra__secret_"
|
local secret="$abra__secret_"
|
||||||
VERSION="$abra__version_"
|
local version="$abra__version_"
|
||||||
LENGTH="$abra__length_"
|
local length="$abra__length_"
|
||||||
|
|
||||||
if [ "$abra___all" == "true" ]; then
|
if [ "$abra___all" == "true" ]; then
|
||||||
# Note(decentral1se): we need to reset the flag here to avoid the infinite
|
# Note(decentral1se): we need to reset the flag here to avoid the infinite
|
||||||
@ -1646,22 +1646,18 @@ sub_app_secret_generate(){
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$LENGTH" ]]; then
|
if [[ -n "$length" ]]; then
|
||||||
if [ -z "$abra__cmd_" ]; then
|
require_binary pwgen
|
||||||
require_binary pwgen
|
abra__cmd_="pwgen -s $length 1"
|
||||||
abra__cmd_="pwgen -s $LENGTH 1"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if [ -z "$abra__cmd_" ]; then
|
require_binary pwqgen
|
||||||
require_binary pwqgen
|
abra__cmd_=pwqgen
|
||||||
abra__cmd_=pwqgen
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
PWGEN=${abra__cmd_}
|
|
||||||
|
|
||||||
|
PWGEN=${abra__cmd_}
|
||||||
debug "SECRET: $SECRET, VERSION $VERSION, PW $PWGEN, ALL $abra___all"
|
debug "SECRET: $SECRET, VERSION $VERSION, PW $PWGEN, ALL $abra___all"
|
||||||
|
|
||||||
if [ -z "$SECRET" ] || [ -z "$VERSION" ] && [ "$abra___all" == "false" ]; then
|
if [ -z "$secret" ] || [ -z "$version" ] && [ "$abra___all" == "false" ]; then
|
||||||
error "Required arguments missing"
|
error "Required arguments missing"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user