#!/bin/sh
#
#NAME
#	Restore - restore files from disk backup
#
#SYNOPSIS
#	Restore [dir [savedir]]
#
#DESCRIPTION
#  Restore all the files in the .savelist file.
#  The default directories are /etc/ and /etc/.save/.
#
#  This is part of an on-disk backup facility.
#
#SEE ALSO
#  Save, savelist
#
#AUTHOR
#  John Chambers <jc@trillian.mit.edu>

if	[ $# -lt 1 ];then set /etc/ /etc/.save;fi
if	[ $# -lt 2 ];then set  $*   /etc/.save;fi
if	[ !  -d $1 ];then echo $1 is not a directory; exit 1; fi
if	[ !  -d $2 ];then echo $2 is not a directory; exit 1; fi
if	[ !  -f $1/.savelist ];then echo $1/.savelist does not exist. exit 1; fi
for	f in `cat $1/.savelist`
do	if [ ! -f $1/$f ];then
		cp $2/$f $1/$f
	fi
done
