#!/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