Skip to content

Instantly share code, notes, and snippets.

@dbsdsun
dbsdsun / varnish_vcl_reload
Created March 2, 2016 22:51
When varnish works with other system, vcl configure is dynamically generated by the front system and set with vcl.inline. There is not a vcl file any more. In this case, we have to use vcl.inline. the following is my varnish_vcl_reload shell script using vcl.inline. Any suggestions are welcome. — wilson.sun330@gmail.com
#!/bin/bash
#
# reload active vcl
# Sometimes, vcl_init needs to be re-run by reloading the active vcl.
# For example, a geoip database is loaded in vcl_init. When the database is updated,
# vcl_init needs to be re-run.
#
# This script saves the currently active vcl to a shell variable, and reloads it to varnish
# Wislon Sun <wilson.sun330@gmail>
#