To receive notifications about scheduled maintenance, please subscribe to the mailing-list You can subscribe to the mailing-list at

Commit 1f3ad74a authored by Axel Beckert's avatar Axel Beckert

Try to use shasum locally if sha256sum is not found locally

Needed for macOS, suggested by Max Schlapfer.
parent 7eca4cd1
......@@ -54,7 +54,8 @@ Requirements
* `sh` (a bourne compatible shell like `ash` or `dash` suffices, `bash` is not needed.)
* `egrep`
* `test` (as `[`)
* `sha256sum`
* `sha256sum` (GNU Coreutils) or `shasum` (Perl, used on macOS)
* `which` to figure out which of the tools above to use.
* `awk` (`mawk` suffices, no `gawk` needed.)
* `scp` (needs to understand options `-q` and `-p`) and `ssh` (needs
to understand options `-a` and `-x`) — OpenSSH is known to work.
......@@ -64,7 +65,7 @@ Requirements
`` uses only these standard POSIX commands and Perl:
* Perl 5, no modules required.
* `sha256sum`
* `sha256sum` (always)
* `getent`
* `awk` (`mawk` suffices, no `gawk` needed.)
* `hostname`
......@@ -17,7 +17,18 @@ if [ -z "$hosts" ]; then
hash=$(sha256sum | awk '{print $1}')
# Generate the local checksum
if which sha256sum > /dev/null; then
elif which shasum; then
localhashsumtool="shasum -a256"
echo "Neither sha256sum nor shasum locally found" 1>&2;
exit 255
hash=$($localhashsumtool | awk '{print $1}')
for host in $hosts; do
scp -qp root@$host:/tmp/
ssh -ax root@$host '[ $(sha256sum /tmp/ | awk '\''{print $1}'\'') = '"$hash"' ] && perl /tmp/ '"$params"'; if [ $(sha256sum /tmp/ | awk '\''{print $1}'\'') != '"$hash"' ]; then echo "$(hostname): WARNING: /tmp/ modified, not deleting"; else rm /tmp/; fi'
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment