+}
+
+[ -n "$3" ] && mountdir=$3
+
+[ -z "$mountdir" ] && err '$mountdir must be set'
+
+rundir=${rundir:-$(dirname $0)}
+
+export PATH=${rundir%/}:/bin:/usr/bin:/sbin:/usr/sbin:/sw/bin
+
+if [ -z "$1" -o ! -d "$2" ]; then
+ err "
+
+Usage: $(basename $0) <source-dir> <relocate-dir> [<mnt-dir>]
+ source-dir - Directory on backup disks to restore (relative to
+ $mountdir)
+ relocate-dir - Base directory to restore files into (usually /)
+ mnt-dir - Directory where backup disk is mounted (optional)
+
+Examples:
+ # Restore everything from disks (explicitly specifying dvd mount point.)
+ % $(basename $0) / / /mnt/cdrom
+
+ # Restore everything from disks
+ % $(basename $0) / /
+
+ # Restore only files under /home on disks to /home on the system
+ % $(basename $0) /home /
+
+ # Restore files under /home on disks to /home/home on the system
+ # (this is usually not what you want.)
+ % $(basename $0) /home /home
+"