2 export rundir=/tmp/restore-$(date +%Y%m%d%H%M%S)
3 if ! mkdir $rundir; then
4 echo >&2 "Cannot create temp dir"
9 export mountdir=$(cd $(dirname $0) && pwd)
11 SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' $0`
13 # take the archive portion of this file and pipe it to tar
14 tail +$SKIP $0 | tar xzf - -C $rundir
16 exec $rundir/restore-script.sh ${1+"$@"}