mirror of https://github.com/kubernetes/kops.git
18 lines
319 B
Bash
Executable File
18 lines
319 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o pipefail
|
|
|
|
in=$1
|
|
out=$2
|
|
|
|
if ( command -v sha1sum > /dev/null ); then
|
|
(sha1sum $in | cut -d' ' -f1) > $out
|
|
elif ( command -v shasum > /dev/null ); then
|
|
(shasum -a 1 $in | cut -d' ' -f1) > $out
|
|
else
|
|
echo "Neither sha1sum nor shasum command is available"
|
|
exit 1
|
|
fi
|