Created
December 8, 2010 18:50
-
-
Save smerrill/733708 to your computer and use it in GitHub Desktop.
Load a new VCL file, replace the running configuration, and set all cache to be purged.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OLD_CFG=`varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 "vcl.list" | grep active | awk '{print $3}'` | |
NEW_CFG="vcl-"`date +%s` | |
varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 "vcl.load $NEW_CFG /etc/varnish/default.vcl" | |
varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 "vcl.use $NEW_CFG" | |
varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 "vcl.discard $OLD_CFG" | |
varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 "purge req.url ~ .*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment