aboutsummaryrefslogtreecommitdiff
path: root/bin/bin/hash-compare
diff options
context:
space:
mode:
Diffstat (limited to 'bin/bin/hash-compare')
-rwxr-xr-xbin/bin/hash-compare17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/bin/hash-compare b/bin/bin/hash-compare
new file mode 100755
index 0000000..49dad54
--- /dev/null
+++ b/bin/bin/hash-compare
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+if [ "$#" -ne 2 ]; then
+ echo "please supply two files to diff"
+else
+ sum1=$(md5sum $1)
+ sum2=$(md5sum $2)
+
+ hash1="${sum1/$1/}"
+ hash2="${sum2/$2/}"
+
+ if [ "$hash1" == "$hash2" ]; then
+ echo "identical"
+ else
+ echo "different"
+ fi
+fi