7.6. Testing for boolean values: ocf_is_true

When a resource agent defines a boolean parameter, the value for this parameter may be specified by the user as 0/1, true/false, or on/off. Since it is tedious to test for all these values from within the resource agent, the agent should instead use the ocf_is_true convenience function:

if ocf_is_true $OCF_RESKEY_superfrobnicate; then
    ocf_run "frobnicate --super"
fi
[Note]Note

If ocf_is_true is used against an empty or non-existant variable, it always returns an exit code of 1, which is equivalent to false.