- We are going to write a script to check whether a file in a directory has been tampered with. Create an integrity_check.sh script and add the following code to it:
#!/bin/bashE_DIR_NOMATCH=50E_BAD_DBFILE=51dbfile=Filerec.md5# storing records.set_up_database (){ echo ""$directory"" > "$dbfile" # Write directory name to first line of file. md5sum "$directory"/* >> "$dbfile" # Append md5 checksums and filenames.}check_database (){ local n=0 local filename local checksum if [ ! -r "$dbfile" ] then echo "Unable to read checksum database file!" exit $E_BAD_DBFILE fi while read rec[n] do directory_checked="${rec[0]}" if [ "$directory_checked" != "$directory" ] then echo "Directories do not match up!" # Tried to use file for a ...