verify.bash moved into restore.lib.bash
This commit is contained in:
parent
b24940098a
commit
acf67abefb
2 changed files with 21 additions and 22 deletions
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
pkgsum="pkgsum"
|
||||||
|
hostsum="hostsums"
|
||||||
|
hashapp="sha256sum"
|
||||||
|
|
||||||
# Extra functions for restore scripts
|
# Extra functions for restore scripts
|
||||||
|
|
||||||
function exclusions () {
|
function exclusions () {
|
||||||
|
@ -18,3 +22,20 @@ function mkfast_deb () {
|
||||||
grep -vf installed_packages_fast installed_packages.orig > installed_packages
|
grep -vf installed_packages_fast installed_packages.orig > installed_packages
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function verify () {
|
||||||
|
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
|
||||||
|
}
|
22
verify.bash
22
verify.bash
|
@ -1,22 +0,0 @@
|
||||||
#!/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
|
|
Loading…
Add table
Add a link
Reference in a new issue