3 # I've occasionally had problems with .shtml inclusion for the header
4 # and footer. Since there's not any processing going on in those
5 # files, they can be straight .html instead. This script makes the
6 # necessary adjustments.
8 # In one installation, the errors raised in the apache logs were
9 # unable to include potential exec
10 # since the SSI handler was attempting to parse the header/footer as
11 # well. I'm not sure why it had a problem with that, but changing
12 # them to .html files means the SSI handler will no longer try to
13 # parse them and you avoid the problem.
16 # Usage: ./html-includes.sh
18 set -e # exit immediately on failed command
19 set -o pipefail # pipes fail if any stage fails
20 set -v # verbose, echo commands to stdout
23 for FILE in $(ls html/shared/ | grep '.shtml$'); do
24 mv -v "html/shared/${FILE}" "html/shared/${FILE/shtml/html}"
25 for CALLER in html/*.shtml; do
26 # correct links for callers
27 sed -i "s/shared\/$FILE/shared\/${FILE/shtml/html}/" "$CALLER"