For anyone who as well experiences a lack of pg_is_in_recovery
in the setup I cam up with the sql level solution a follows
IN_RECOVER_QUERY="do \$\$ begin assert (select pg_is_in_recovery()) = 't', 'no recover';end;\$\$;"
psql -c "$IN_RECOVER_QUERY" -v ON_ERROR_STOP=1
@Laurenz Albe Could you please review, maybe it could be simplified even more.
Thanks