#!/bin/sh

if [ -z "${DESTDIR}" ]; then
  echo "$0: you must set the environment variable DESTDIR to the destination directory" >/dev/stderr;
  echo "$0: e.g. export DESTDIR=/`/bin/date +%Y%m%d`" >/dev/stderr;
  exit 69;
fi

tar cf - /.bash* /.cshrc /.inputrc /.profile /.rnd /.shrc /COPYRIGHT /boot/device.hints /boot/loader.conf /boot/modules /boot/zfs /entropy /etc /root | (cd ${DESTDIR}; tar xvvf -)
ln -s usr/compat ${DESTDIR}/compat
ln -s /usr/local/bin/perl5.16.3 ${DESTDIR}/usr/bin/perl
ln -s /usr/local/bin/perl5.16.3 ${DESTDIR}/usr/bin/perl5

#history -a
#cat /root/.bash_history > ${DESTDIR}/root/.bash_history
