#!/bin/bash # # pak-web-scan -- 2008-09-01, last edit 2008-09-06 # # discover semi-static ssi include files and provide a list of absolute # filepaths along with the SSI directive tag for inclusion on the # pak-web-site script command line # # Copyright (C) 2008 Grant Coady GPLv2 # # call: pak-web-site ... -v ssi_list="$(pak-web-scan)" ... # # list format: # path_1;ssi_tag_1:path_2;ssi_tag_2: [...] path_n;ssi_tag_n # # output list is sorted and contains no duplicate entries # # may be called from below $doc_root when performing a partial site update, # no sanity checking for being called outside of the server document area # # all ssi file include directives must have full path from doc_root to # include file, active (ie. required at web delivery time) SSI includes # (eg. netdraw) not to use full paths and/or the .html file extension so # they're not caught by this script (even if they were caught, they'd be # thrown out by pak-web-site due to lack of signature) # doc_root="/home/web/bugsplatter" grep -r '.*$/, "") sub(/^.*" } /^\// && /\.(html|text)$/ { ++list[doc_root $1 ";" link]; next } END { n = asorti(list, sorted) for (i = 1; i <= n; i++) { s = (s ? s ":" : "") sorted[i] } print s }' # end