-
Notifications
You must be signed in to change notification settings - Fork 2
/
csa_rec.sh
27 lines (23 loc) · 848 Bytes
/
csa_rec.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
###################################################################################################
#
# csa_rec.sh - Shell Script to Recursively Compress Static (Web) Assets
#
# This script looks for compressible files and uses the csa.sh script to
# create gzipped (.gz) and brotlified (.br) copies of the original file.
#
# Author: Uwe Trenkner
# URL: https://github.com/utrenkner/csa
#
# License: BSD (2-Clause)
#
# Version 0.1
#
###################################################################################################
# Enter "/path/to/csa.sh" script
csa="/path/to/csa.sh"
# Define, which files are to be compressed
compressible="css|js|svg|htm[l]?|xml"
# Enter directory to start (recursively) looking for compressible files
dir="/usr/local/www/data"
find -E $dir -regex ".*\.($compressible)" -exec sh -x $csa {} \;