diff options
author | Paweł Krupa <pawel@krupa.net.pl> | 2019-02-25 11:47:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-25 11:47:06 +0100 |
commit | 48a15d16425061b684b36fe14c119ec692e2394c (patch) | |
tree | 36af91e37dcf1c93f17ab2a39598b46c9a1ee24f /tests | |
parent | 49096cc0e8a4179c56d6a89f63814f6096ac750f (diff) |
prevent merging changes to kickstart.sh when checksum in docs is wrong (#5498)
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/installer/checksums.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/installer/checksums.sh b/tests/installer/checksums.sh new file mode 100755 index 0000000000..2c0279015a --- /dev/null +++ b/tests/installer/checksums.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +if [ ! -f .gitignore ]; then + echo "Run as ./tests/installer/$(basename "$0") from top level directory of git repository" + exit 1 +fi + +for file in kickstart.sh kickstart-static64.sh; do + OLD_CHECKSUM=$(grep "$file" packaging/installer/README.md | grep md5sum | cut -d '"' -f2) + NEW_CHECKSUM="$(md5sum "packaging/installer/$file" | cut -d' ' -f1)" + if [ "$OLD_CHECKSUM" != "$NEW_CHECKSUM" ]; then + echo "Invalid checksum for $file in docs." + echo "checksum in docs: $OLD_CHECKSUM" + echo "current checksum: $NEW_CHECKSUM" + exit 1 + fi +done |