diff --git a/testdefs.sh b/testdefs.sh index 28ca2703..47083871 100644 --- a/testdefs.sh +++ b/testdefs.sh @@ -67,10 +67,10 @@ extract_stdout_keyvalue_optional() { if [ -n "$_line" ]; then _value="${_line#*$_delim}" _return=0 - fi - if [ -n "$_var" ]; then - eval $_var="\$_value" - eval tfw_log "$_var=\$(shellarg "\${$_var}")" + if [ -n "$_var" ]; then + eval $_var="\$_value" + eval tfw_log "$_var=\$(shellarg "\${$_var}")" + fi fi return $_return } @@ -743,15 +743,15 @@ create_identities() { # If the DID and/or NAME is already specified in the variables, then use # them, otherwise extract the DID and NAME automatically generated by # servald. - if [ -n "${!didvar}" -o -n "${!namevar}" ]; then + if [ -n "${!didvar+x}" -o -n "${!namevar+x}" ]; then executeOk_servald keyring set did "${servald_options[@]}" "${!sidvar}" "${!didvar}" "${!namevar}" eval "$didvar=\${!didvar}" eval "$namevar=\${!namevar}" tfw_log "$didvar=$(shellarg "${!didvar}")" tfw_log "$namevar=$(shellarg "${!namevar}")" else - extract_stdout_keyvalue_optional $didvar did "$rexp_did" && tfw_log "$didvar=$(shellarg "${!didvar}")" - extract_stdout_keyvalue_optional $namevar name ".*" && tfw_log "$namevar=$(shellarg "${!namevar}")" + extract_stdout_keyvalue_optional $didvar did "$rexp_did" + extract_stdout_keyvalue_optional $namevar name ".*" fi done for ((i = 1; i <= N; ++i)); do