build.sh (950B)
1 #!/usr/bin/env bash
2
3 echo "Starting..."
4 echo "----------"
5 echo "# Exclude error-pages from Proxy"
6 echo "ProxyPass /error_pages/ !"
7 echo "# Set Error Documents"
8
9 mkdir -p ./error_pages/
10
11 ## 400 pages
12 seq_400="$(seq 400 1 417) $(seq 421 1 424) 426 428 429 431 451"
13 for i in $seq_400; do
14 cp "./template.html" "./error_pages/${i}.html"
15 sed -e "s/<!--%ERRORCODE%-->/${i}/g" \
16 -e "s/<!--%ERROREXPLAIN%-->/The requested content might not be available or you are not allowed to see it./" \
17 -i "./error_pages/${i}.html"
18 echo "ErrorDocument ${i} /error_pages/${i}.html"
19 done
20
21 ## 500 pages
22 seq_500="$(seq 500 1 508) 510 511"
23 for i in $seq_500; do
24 cp "./template.html" "./error_pages/${i}.html"
25 sed -e "s/<!--%ERRORCODE%-->/${i}/g" \
26 -e "s/<!--%ERROREXPLAIN%-->/The Service is currently under maintenance./" \
27 -i "./error_pages/${i}.html"
28 echo "ErrorDocument ${i} /error_pages/${i}.html"
29 done
30
31 echo "----------"
32 echo "Done!"
33