Saf2 gh 765 add env check target

Yeah, it's a stack-overflow special, so I just pasted what they had with minimal editing.  I'll fix these too.