If you run test1.sh, you'll see
test1.sh
test1.sh
exit
If you run test2.sh, you'll see
test2.sh
test1.sh
test1.sh
#!/bin/sh
echo $0
echo $BASH_SOURCE
if [ $0 = $BASH_SOURCE ]; then
echo "exit"
exit 0;
fi
test2.sh
#!/bin/sh
. test1.sh