Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/common-functions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common-functions')
-rwxr-xr-xlib/common-functions14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/common-functions b/lib/common-functions
index 65189dc..a4cc1ef 100755
--- a/lib/common-functions
+++ b/lib/common-functions
@@ -704,3 +704,17 @@ irc_say() {
fi
fi
}
+
+# calculate_script_checksum
+# calculate and print a checksum of the main script and all scripts in lib/
+calculate_script_checksum() {
+ {
+ sha512sum "$0"
+ find "${base_dir}/lib" -type f \
+ -exec sha512sum '{}' \;
+ } | \
+ sort | \
+ awk '{print $1}' | \
+ sha512sum | \
+ awk '{print $1}'
+}