Commit a1e85273 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Add configtest command to RH init script

parent 0e2be436
...@@ -114,6 +114,14 @@ rh_status_q() { ...@@ -114,6 +114,14 @@ rh_status_q() {
rh_status >/dev/null 2>&1 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. # See how we were called.
case "$1" in case "$1" in
start) start)
...@@ -141,6 +149,9 @@ case "$1" in ...@@ -141,6 +149,9 @@ case "$1" in
rh_status_q || exit 0 rh_status_q || exit 0
restart restart
;; ;;
configtest)
configtest
;;
*) *)
echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment