3 # A simple shell script to delete a media from Apache's mod_disk_cache.
4 # You will likely need to setup a sudo rule like the following:
6 # Cmnd_Alias HTCACHECLEAN = /usr/local/sbin/htcacheclean
7 # pleroma ALL=HTCACHECLEAN, NOPASSWD: HTCACHECLEAN
11 # mod_disk_cache directory
12 CACHE_DIRECTORY
="/tmp/pleroma-media-cache"
14 ## Removes an item via the htcacheclean utility
15 ## $1 - the filename, can be a pattern .
16 ## $2 - the cache directory.
18 sudo htcacheclean
-v -p "${2}" "${1}"
24 echo "$SCRIPTNAME delete \`$url\` from cache ($CACHE_DIRECTORY)"
25 purge_item
"$url" $CACHE_DIRECTORY