You could use a function like [man]sha1_file/man to get a hash of the file in question, then compare it to the expected value in your main script. However, this still begs the question of how you prevent somebody from messing with that part of your script unless you use some sort of source code protection mechanism (and be careful about those, as there are a lot for sale on the web that are actually quite easy to crack).