3 # get text contents from sources, return creation/modification time
4 # and source description together with text through stdout
5 # (non-zero exit code in case of error)
7 .
`dirname $0`/constants.sh
9 # parse protocol and source from argument
13 # genesis time, less than 0 means failure
16 # temporary and log file
17 tmpf
=${TMP:-/tmp}/fetcher-
$proto-$$.tmp
18 logf
=${TMP:-/tmp}/fetcher-log-
`date +%y%U`.log
21 # timeout for total script is 3 times that for fetch operation
22 timeout
=`expr $FETCHTIMEOUT '*' 3`
24 logit
() { echo : "$@" >>$logf ; }
34 statstat
=`stat --help 2>&1|head -n 1`
36 Usage
*) gen
=`stat -c %Y "$src"` ;;
37 "stat: unknown option"*) gen
=`stat -f %a "$src"` ;;
41 logit getting
file: $src ...
45 wget
-a $logf -O $tmpf -T $FETCHTIMEOUT "$proto://$src" && gen
=`date +%s`
54 echo SOURCE
$proto://$src