248:b0ab699aeb36
Anton Shestakov <av6@dwimlabs.net>, Sat, 03 Dec 2016 15:27:10 +0800
pipelines: install curl for contrib/updatesri.sh check

next change 282:72b0672a98f7
previous change 213:48c311d68f60

contrib/updatesri.sh

Permissions: -rwxr-xr-x

Other formats: Feeds:
#!/bin/bash
set -euo pipefail
( egrep -oh 'https://[^"]+\.js' "$@" || true ) | sort -u | while read url; do
hash=$(curl -fsS "$url" | openssl dgst -sha384 -binary | openssl base64 -A)
sed -i "\|$url| c\\ <script src=\"$url\" integrity=\"sha384-$hash\" crossorigin=\"anonymous\"></script>" "$@"
done
( egrep -oh 'https://[^"]+\.css' "$@" || true ) | sort -u | while read url; do
hash=$(curl -fsS "$url" | openssl dgst -sha384 -binary | openssl base64 -A)
sed -i "\|$url| c\\ <link rel=\"stylesheet\" href=\"$url\" integrity=\"sha384-$hash\" crossorigin=\"anonymous\">" "$@"
done