Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Reload a varnish config
- # Author: Kristian Lyngstol
- FILE="/opt/varnish/etc/varnish/default.vcl"
- # Hostname and management port
- # (defined in /etc/default/varnish or on startup)
- HOSTPORT="localhost:6082"
- NOW=`date +%s`
- error()
- {
- echo 1>&2 "Failed to reload $FILE."
- exit 1
- }
- /opt/varnish/bin/varnishadm -T $HOSTPORT vcl.load reload$NOW $FILE || error
- /opt/varnish/bin/varnishadm -T $HOSTPORT vcl.use reload$NOW || error
- echo Current configs:
- /opt/varnish/bin/varnishadm -T $HOSTPORT vcl.list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement