added boolean check for password variables

This commit is contained in:
2023-02-03 19:42:48 +01:00
parent c76c47048a
commit 9f1173753a

View File

@@ -43,7 +43,8 @@ while read -r -u 3 line; do
value=${currvar[1]::-1}
# check if there's a password to generate
if [[ ${currvar[0]} =~ (PASS|PASSWORD|PWD|PASSWD)$ ]]; then
if [[ ! ${currvar[1],,} =~ ^(true|false|yes|no)$ ]] && \
[[ ${currvar[0]} =~ (PASS|PASSWORD|PWD|PASSWD)$ ]]; then
value=$(openssl rand -base64 29 | tr -d "=+/" | cut -c1-25)
fi