Merge pull request #954 from openziti/953-missing-character-set-on-mac-causes-generated-password-to-fail

force single-byte locale in command "tr" when generating random password
This commit is contained in:
Ken Bingham
2023-01-17 16:20:13 -05:00
committed by GitHub
@@ -1077,7 +1077,7 @@ function ziti_createEnvFile {
if [[ "${ZITI_USER-}" == "" ]]; then export ZITI_USER="admin"; fi
if [[ "${ZITI_PWD-}" == "" ]]; then
ZITI_PWD="$(tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c32)"
ZITI_PWD="$(LC_ALL=C tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c32)"
echo -en "Do you want to keep the generated admin password '$ZITI_PWD'? (Y/n) "
# shellcheck disable=SC2162
read -r pwd_reply