Created
January 16, 2024 17:15
-
-
Save localzet/c0bb144e5ffaf3c9bfa4b414a5d73d70 to your computer and use it in GitHub Desktop.
mime.type generator
This file contains 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 | |
MIME_TYPES=$(wget -qO- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types | sed '/^#/d') | |
echo "types {" > ./mime.types; | |
echo "$MIME_TYPES" | while read -r line | |
do | |
TYPE=$(echo $line | awk '{print $1}') | |
EXTENSIONS=$(echo $line | cut -d' ' -f2-) | |
for EXT in $EXTENSIONS | |
do | |
echo " $TYPE $EXT;" >> ./mime.types; | |
done | |
done | |
echo "}" >> ./mime.types; | |
echo "Файл mime.types успешно создан." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment