Skip to content

Instantly share code, notes, and snippets.

@gnanet
Created September 13, 2015 21:05
Show Gist options
  • Save gnanet/c5b8ce186b65b25351f5 to your computer and use it in GitHub Desktop.
Save gnanet/c5b8ce186b65b25351f5 to your computer and use it in GitHub Desktop.
Varnish configtest, with preliminary test for the presence of includes
#!/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