diff options
author | B. Stack <bgstack15@gmail.com> | 2022-05-17 19:28:28 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-05-17 19:28:28 -0400 |
commit | 90eeb416202f159c61046939760f5e16e9363f2a (patch) | |
tree | 31c6d31342d456cefc868c6cc79b18d59ca2c10f /update-infcloud-cache | |
parent | improve config, and add .gitremotes (diff) | |
download | radicaleinfcloud-90eeb416202f159c61046939760f5e16e9363f2a.tar.gz radicaleinfcloud-90eeb416202f159c61046939760f5e16e9363f2a.tar.bz2 radicaleinfcloud-90eeb416202f159c61046939760f5e16e9363f2a.zip |
add initial rpm spec and stackrpms readme
Diffstat (limited to 'update-infcloud-cache')
-rwxr-xr-x | update-infcloud-cache | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/update-infcloud-cache b/update-infcloud-cache new file mode 100755 index 0000000..071ec77 --- /dev/null +++ b/update-infcloud-cache @@ -0,0 +1,15 @@ +#!/bin/bash +# File: /usr/sbin/update-infcloud-cache +# Part of infcloud rpm for stackrpms +# Use this script every time you modify any file to force browsers to reload it (empty HTML5 cache). + +USE_BIN=none +MANIFEST=/etc/infcloud/cache.manifest +test -e $( command -v ed 2>/dev/null ) && USE_BIN=ed +test -e $( command -v sed 2>/dev/null ) && USE_BIN=sed +command -v "${USE_BIN}" &> /dev/null || { echo "Error: 'ed' not installed. Aborting." > /dev/stderr; exit 1; } +case "${USE_BIN}" in + ed) printf ",s/#V.*/#V $(date '+%Y%m%d%H%M%S')/\nw\nq\n" | ed -s "${MANIFEST}" ;; + sed) sed -i -r -e "s/^#V.*/#V $(date "+%Y%m%d%H%M%S" )/;" "${MANIFEST}" ;; + *) echo "Error: need ed or sed. Aborted." 1>/dev/stderr ; exit 1 ;; +esac |