If it was the exit code and not the result, you could just use
if func arg; then ...
If you cannot make the function return a proper exit code (with
return N), and you have to use string results, use Alex Gitelman’s answer.
$ help if:
if: if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]… [ else COMMANDS; ] fi
Execute commands based on conditional.
if COMMANDSlist is executed. If its exit status is zero, then the
then COMMANDSlist is executed. Otherwise, each
elif COMMANDSlist is
executed in turn, and if its exit status is zero, the corresponding
then COMMANDSlist is executed and the if command completes. Otherwise,
else COMMANDSlist is executed, if present. The exit status of the
entire construct is the exit status of the last command executed, or zero
if no condition tested true.
Returns the status of the last command executed.