[master] a1e8527 Add configtest command to RH init script
Tollef Fog Heen
tfheen at varnish-cache.org
Tue Apr 26 11:02:10 CEST 2011
commit a1e852734dc6969e6b2027423d6f2793f3b0c8ba
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date: Tue Apr 26 11:01:50 2011 +0200
Add configtest command to RH init script
diff --git a/redhat/varnish.initrc b/redhat/varnish.initrc
index e7815ce..19cc274 100755
--- a/redhat/varnish.initrc
+++ b/redhat/varnish.initrc
@@ -114,6 +114,14 @@ rh_status_q() {
rh_status >/dev/null 2>&1
}
+configtest() {
+ if [ -f "$VARNISH_VCL_CONF" ]; then
+ $exec -f "$VARNISH_VCL_CONF" -C -n /tmp > /dev/null && echo "Syntax ok"
+ else
+ echo "VARNISH_VCL_CONF is unset or does not point to a file"
+ fi
+}
+
# See how we were called.
case "$1" in
start)
@@ -141,6 +149,9 @@ case "$1" in
rh_status_q || exit 0
restart
;;
+ configtest)
+ configtest
+ ;;
*)
echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
More information about the varnish-commit
mailing list