Created
January 23, 2026 11:54
-
-
Save cloudscape-germany/37fdf48d6926f1d5073e5262329e6f4a to your computer and use it in GitHub Desktop.
Bash SRI Checker for PrivateBin Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| grep -o "js/[^']*\.js" lib/Configuration.php | while read f; do | |
| h=$(openssl dgst -sha512 -binary "$f" | openssl enc -base64 | tr -d '\n') | |
| sed -i.bak "s|'$f' => 'sha512-[^']*'|'$f' => 'sha512-$h'|" lib/Configuration.php | |
| done | |
| rm -f lib/Configuration.php.bak |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment