Linux Shell Scripts

#!/bin/bash
url=$1 && file=“${url##*/}“ && wget $url && extension=“${url##*.}“ && echo -e „\n\n“

if [ $extension = ‚js‘ ]
then
echo -e „Generate JS HTML output\n“
echo -ne „<script type=\“text/javascript\“ src=\“$url\“ integrity=\“sha256-“ && echo -ne openssl dgst -sha256 -binary url | openssl base64 -A && echo -e „\“ crossorigin=\“anonymous\“></script>\n\n“

elif [ $extension = ‚css‘ ]
then
echo -e „Generate CSS HTML output\n“
echo -ne „<link rel=\“stylesheet\“ href=\“$url\“ integrity=\“sha256-“ && echo -ne openssl dgst -sha256 -binary url | openssl base64 -A && echo -e „\“ crossorigin=\“anonymous\“></script>\n\n“

elif [ $extension = ‚webp‘ | $extension = ‚png‘ | $extension = ‚webp‘ | $extension = ‚png‘]
then
echo -e „Generate CSS HTML output\n“
echo -ne „<link rel=\“stylesheet\“ href=\“$url\“ integrity=\“sha256-“ && echo -ne openssl dgst -sha256 -binary url | openssl base64 -A && echo -e „\“ crossorigin=\“anonymous\“></script>\n\n“

else echo -ne „integrity=\“sha256-“ && echo -ne openssl dgst -sha256 -binary url | openssl base64 -A && echo -e „\“ crossorigin=\“anonymous\“\n\n“
fi

Schreibe einen Kommentar