File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252 SOPS_TARGET_FILE="sops-${VERSION}.${ARCH}.exe"
5353 fi
5454
55+ SOPS_CHECKSUMS_FILE="sops-$VERSION.checksums.txt"
5556 SOPS_DOWNLOAD_URL="https://github.com/getsops/sops/releases/download/${VERSION}/"
5657 echo "Downloading sops from $SOPS_DOWNLOAD_URL/$SOPS_TARGET_FILE"
58+
5759 curl -fsSL -o "$DL_DIR/$SOPS_TARGET_FILE" "$SOPS_DOWNLOAD_URL/$SOPS_TARGET_FILE"
60+ curl -fsSL -o "$DL_DIR/$SOPS_CHECKSUMS_FILE" "$SOPS_DOWNLOAD_URL/$SOPS_CHECKSUMS_FILE"
61+
62+ echo "Verifying checksum"
63+ sum=$(openssl sha1 -sha256 "$DL_DIR/$SOPS_TARGET_FILE" | awk '{print $2}')
64+
65+ expected_sum=$(grep "$SOPS_TARGET_FILE" "$DL_DIR/$SOPS_CHECKSUMS_FILE" | awk '{print $1}')
66+ if [ "$sum" != "$expected_sum" ]; then
67+ echo "SHA sum of $SOPS_TARGET_FILE does not match. Aborting."
68+ exit 1
69+ fi
5870
5971 echo "Installing sops to ${SOPS_TOOL_DIR}"
6072 mkdir -p "$SOPS_TOOL_DIR"
You can’t perform that action at this time.
0 commit comments