From 99f3254ec2e4b43b4010d5ba4aeacd6d0221aea5 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sun, 7 Apr 2013 16:53:58 -0700 Subject: [PATCH] add varnish_configtest --- bin/varnish_configtest | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 bin/varnish_configtest diff --git a/bin/varnish_configtest b/bin/varnish_configtest new file mode 100644 index 0000000..2608aef --- /dev/null +++ b/bin/varnish_configtest @@ -0,0 +1,13 @@ +#!/bin/sh + +# from http://unix.stackexchange.com/questions/35863/varnish-configtest + +tmpfile=$(mktemp) +trap 'rm -f $tmpfile' 0 +varnishd -C -f /etc/varnish/default.vcl > $tmpfile +echo + +if [ ! -s $tmpfile ]; then + echo "ERROR: There are errors in the varnish configuration." >&2 + exit 1 +fi