Advertisement
Guest User

Untitled

a guest
May 27th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/bin/bash
  2. # Reload a varnish config
  3. # Author: Kristian Lyngstol
  4.  
  5. FILE="/opt/varnish/etc/varnish/default.vcl"
  6.  
  7. # Hostname and management port
  8. # (defined in /etc/default/varnish or on startup)
  9. HOSTPORT="localhost:6082"
  10. NOW=`date +%s`
  11.  
  12. error()
  13. {
  14. echo 1>&2 "Failed to reload $FILE."
  15. exit 1
  16. }
  17.  
  18. /opt/varnish/bin/varnishadm -T $HOSTPORT vcl.load reload$NOW $FILE || error
  19. /opt/varnish/bin/varnishadm -T $HOSTPORT vcl.use reload$NOW || error
  20. echo Current configs:
  21. /opt/varnish/bin/varnishadm -T $HOSTPORT vcl.list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement