#!/bin/sh
#
# A simple startupscript to start arla for *BSD.
# 
# You must have a path that includes, modload, ld, 
# mount_xfs, and arlad.
#
# $Id: startarla.in,v 1.13 2000/04/25 23:05:13 ahltorp Exp $
#


PATH="/sbin:/usr/sbin:/usr/bin:/bin:%bindir%"
BINDIR=%bindir%
CACHEDIR=%ARLACACHEDIR%

if [ ! -e $CACHEDIR ] ; then
   mkdir $CACHEDIR
   chmod 700 $CACHEDIR
   chown root $CACHEDIR
fi

if test -f  $BINDIR/xfs.ko; then
  if test ! -c /dev/xfs0; then
    mknod /dev/xfs0 c 128 0
  fi
  kldload $BINDIR/xfs.ko
elif [ -x /sbin/kmodload ]; then
  kmodload $BINDIR/xfs_mod.o
else
  modload -e xfs_mod -p $BINDIR/xfs_makedev $BINDIR/xfs_mod.o
fi
test -d /afs || mkdir /afs
mount_xfs /dev/xfs0 /afs
arlad -z /dev/xfs0
