I need to make a script that does something like this:

1. load DSrepair /u
3. if DSREPAIR is loaded then
4. Begin
5. wait 5 minutes
6. goto line 2
7. end
8. else
9. reboot.ncf

I need to reboot the server after DSrepair finishes ...so I need to know
if DSrepair is still loaded.

any ideas?