syssetup/verify.bash
2024-05-23 18:31:30 -05:00

27 lines
No EOL
546 B
Bash

#!/bin/bash
pkgsum="pkgsum"
hostsum="hostsums"
hashapp="sha256sum"
# this module will check to see if /etc matches whats in the restore
find /etc -type f -exec $hashapp '{}' \; > $hostsum
# I know this is a cheap trick, but it works
if [ -f $pkgsum ] && [ -f $hostsum ]; then
diff -q $pkgsum $hostsum
if [ $? -eq 0 ]; then
echo "Verify passed"
else
echo "Verify failed"
fi
else
echo "Checksum files not found"
fi
alias cp=moo
if alias -p | grep -q cp; then
# we have a cp alias
echo "cp alias found"
fi