In the old Scratchbox one could do something like:
if [ -f /targets/links/scratchbox.config ]; then
echo "here goes my sbox-dependent stuff"
fi
but what about Scratchbox2, is there a way to find out this?
How about test the environment variable 'LD_PRELOAD'
if [[ $LD_PRELOAD =~ "sb2" ]]; then
true # is running under sb2
fi