Created
October 2, 2016 14:04
-
-
Save ScottHelme/3abaca82e0d50c6e7f55a0a4b3b2c63d to your computer and use it in GitHub Desktop.
Compress all blog assets with Brotli.
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 | |
for x in `find /var/www/ghost/content/themes/futura/assets/js/ -type f -iname '*.js'` | |
do | |
sudo /home/scott/nginx/brotli/bin/bro --input ${x} --output ${x}.br | |
sudo chown scott:ghost ${x}.br | |
sudo chmod 664 ${x}.br | |
done | |
for x in `find /var/www/ghost/content/themes/futura/assets/css/ -type f -iname '*.css'` | |
do | |
sudo /home/scott/nginx/brotli/bin/bro --input ${x} --output ${x}.br | |
sudo chown scott:ghost ${x}.br | |
sudo chmod 664 ${x}.br | |
done | |
for x in `find /var/www/ghost/content/themes/futura/assets/images/ -type f -iname '*.png'` | |
do | |
sudo /home/scott/nginx/brotli/bin/bro --input ${x} --output ${x}.br | |
sudo chown scott:ghost ${x}.br | |
sudo chmod 664 ${x}.br | |
done | |
for x in `find /var/www/ghost/content/themes/futura/assets/images/ -type f -iname '*.jpg'` | |
do | |
sudo /home/scott/nginx/brotli/bin/bro --input ${x} --output ${x}.br | |
sudo chown scott:ghost ${x}.br | |
sudo chmod 664 ${x}.br | |
done | |
for x in `find /var/www/ghost/content/images/ -type f -iname '*.jpg'` | |
do | |
sudo /home/scott/nginx/brotli/bin/bro --input ${x} --output ${x}.br | |
sudo chown scott:ghost ${x}.br | |
sudo chmod 664 ${x}.br | |
done | |
for x in `find /var/www/ghost/content/images/ -type f -iname '*.png'` | |
do | |
sudo /home/scott/nginx/brotli/bin/bro --input ${x} --output ${x}.br | |
sudo chown scott:ghost ${x}.br | |
sudo chmod 664 ${x}.br | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment