diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-08-20 21:02:00 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-08-20 21:02:00 -0300 |
commit | 0220c9924c6fb633e7cd55be548a1604fdf4f63c (patch) | |
tree | 08d2f1e4b5c5b1c3556fc81893619e73b0835285 /sri-hash | |
parent | e851401694daacaf1aba2c87ed557e5dbf00af02 (diff) | |
download | scripts-0220c9924c6fb633e7cd55be548a1604fdf4f63c.tar.gz scripts-0220c9924c6fb633e7cd55be548a1604fdf4f63c.tar.bz2 |
Move scripts to other repositories (2)
Diffstat (limited to 'sri-hash')
-rwxr-xr-x | sri-hash | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/sri-hash b/sri-hash deleted file mode 100755 index 5979c39..0000000 --- a/sri-hash +++ /dev/null @@ -1,34 +0,0 @@ -#/bin/sh -# -# SRI Hash Generator -# - -# Parameters -BASENAME="`basename $0`" -URI="$1" - -# Check -if [ -z "$URI" ]; then - echo "usage: $BASENAME <file-or-url>" - exit 1 -fi - -# Get file -if echo "$URI" | grep -q '^http'; then - echo "downloading $URI and generating hash..." - HASH="`curl $URI | openssl dgst -sha384 -binary | openssl base64 -A`" - echo "" -else - if [ -e "$URI" ]; then - # See https://www.srihash.org/ - HASH="`openssl dgst -sha384 -binary $URI | openssl base64 -A`" - else - echo "file not found: $URI" - exit 1 - fi -fi - -# Generate -cat <<EOF -<script src="$URI" integrity="sha384-$HASH" crossorigin="anonymous"></script> -EOF |