Created
September 13, 2015 21:05
-
-
Save gnanet/c5b8ce186b65b25351f5 to your computer and use it in GitHub Desktop.
Varnish configtest, with preliminary test for the presence of includes
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 | |
missing=0 | |
while read inc | |
do | |
if [ ! -f "${inc}" ] | |
then | |
echo "Missing: ${inc}" | |
missing=$((missing+1)) | |
fi | |
done < <(grep include /etc/varnish/default.vcl | awk -F'"' {' print $2 '} ) | |
if [ $missing -gt 0 ] | |
then | |
echo "Detected $missing missing includes. Aborting" | |
exit 1 | |
fi | |
varnishd -C -f /etc/varnish/default.vcl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment