#!/bin/bash if [ $1 = "" ]; then exit 0 fi if [ ! -d /var/cache/wwwoffle/http/$1 ]; then exit 0 fi mkdir $1 fullhost="http://"$1 old=`pwd` cd /var/cache/wwwoffle/http/$1 for i in U*; do url=`cat $i` fn=${url#$fullhost} file=D${i#"U"} if `echo $fn|egrep -q "/$"`; then mkdir -p $old/$1$fn cat $file | awk 'i==1 { print } /^\r$/ { i=1 }'> $old/$1$fn/index.html else mkdir -p `dirname $old/$1$fn` cat $file | awk 'i==1 { print } /^\r$/ { i=1 }' > $old/$1$fn fi done