This repository has been archived on 2023-08-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2016-11-15 08:49:54 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
#
|
|
|
|
|
# this script can be called via hooks for each post to purge varnish cache on new post
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# ip to bind to when doing http request
|
|
|
|
|
ip="127.0.1.1"
|
|
|
|
|
|
2016-11-15 08:51:57 -05:00
|
|
|
varnish="127.0.0.1:8000"
|
|
|
|
|
|
2016-11-15 08:49:54 -05:00
|
|
|
# purge thread page
|
2016-11-15 08:58:59 -05:00
|
|
|
curl --interface "$ip" -X PURGE http://$varnish/thread-$(sha1sum <<< "$3" | cut -d' ' -f1).html &> /dev/null
|
2016-11-15 08:49:54 -05:00
|
|
|
# purge board page
|
2016-11-15 08:52:55 -05:00
|
|
|
curl --interface "$ip" -X PURGE http://$varnish/$1-0.html &> /dev/null
|