Post modification script and custom fields

I’m having a hard time finding any info on this. I have a custom field called subdomain and it’s a “Yes/No” option. I have a post modification script set up and have been trying to do some steps if subdomain is set to yes or no.
I originally tried:

if [ “$VIRTUALSERVER_FIELD_subdomain” = 1 ]; then
echo “yar” > it_worked.txt
fi

Also tried this just to make sure it’s not handled differently than other variables:

if [ “$FIELD_subdomain” = 1 ]; then
echo “yar” > it_worked.txt
fi

I’ve looked for the following values: 1/0, “1”/“0”, true/false, “Yes”/“No”
I just can’t seem to check this value. I know the script is working as all my other processing is happening it’s just the checks on the custom field that aren’t working.

edit: more info

Is it not possible for custom fields to be accessed from the post modification scripts?