# $Id$

umask 022
if [ ! -d /afs ]; then
  mkdir /afs
fi

strip -x /usr/vice/bin/*

if [ -d /boot/kernel ]; then
  cp -p /usr/vice/etc/libafs.ko /boot/kernel
elif [ -d /modules ]; then
  cp -p /usr/vice/etc/libafs.ko /modules
fi

echo "Fetching CellServDB..."
ftp -o /usr/vice/etc/CellServDB http://grand.central.org/dl/cellservdb/CellServDB

echo -n 'Please enter your cell name: '
sh -c 'read REPLY; echo $REPLY >/usr/vice/etc/ThisCell'

if ! grep -q '^\. /usr/vice/etc/rc.securelevel.afs' /etc/rc.local; then
  echo 'adding rc.securelevel.afs to /etc/rc.local'
  echo '. /usr/vice/etc/rc.securelevel.afs' >>/etc/rc.local
else
  echo 'rc.securelevel.afs is already in /etc/rc.local'
fi

echo 'Reboot to start OpenAFS.'
