Merge branch 'develop' into docs/apache-config
[akkoma] / installation / apache-cache-purge.sh.example
1 #!/bin/sh
2
3 # A simple shell script to delete a media from Apache's mod_disk_cache.
4
5 SCRIPTNAME=${0##*/}
6
7 # mod_disk_cache directory
8 CACHE_DIRECTORY="/tmp/pleroma-media-cache"
9
10 ## Removes an item via the htcacheclean utility
11 ## $1 - the filename, can be a pattern .
12 ## $2 - the cache directory.
13 purge_item() {
14 htcacheclean -p "${2}" "${1}"
15 } # purge_item
16
17 purge() {
18 for url in "$@"
19 do
20 echo "$SCRIPTNAME delete \`$url\` from cache ($CACHE_DIRECTORY)"
21 purge_item "$url" $CACHE_DIRECTORY
22 done
23 }
24
25 purge "$@"