Your answer was actually correct. When you run a program (or a script), it has an exit status. This is just an integer =/< 0. When running exit 0 in a shell script, you just set the shell variabel $? on 0. You can then use this in lets say an if:
Code:
if yourscript
then
#Your exit status was 0
do_something
else
#Your exit status was > 0
dosomeotherthing
fi
It is also possible to just 'echo $?', this will give you the exit status of last program run.