Bash

-n

Test if the string is not empty.

if [ -n "$generated_config" ]; then
  ...
fi

If $generated_config is defined (= not empty), then do the work.