I wondering what options exist to write a shell script that verifies itself to make sure it's not corrupt or has been modified.
For example:
c=( $(\cksum ${BASH_SOURCE[0]}) )
[ ${c[1]} -ne 18028 ] && echo problem
The above simply verifies the amount of characters, but I would prefer to use a CRC checksum. I can calculate the checksum, but the problem is that I cannot add the checksum to the script without changing the result and thereby invalidating the checksum.
Thanks.