#! /bin/sh

##########################################################################
#           Copyright (c) 2003, XiMeta, Inc. All Rights Reserved
##########################################################################
#
# Darwin/OSX XiMeta NetDisk Meta package installation script.
#
###########################################################################

ID="/usr/bin/id"
WHOAMI=`$ID|sed -e 's/(.*//'`
SYSTEM=`uname -sr`

if [ "$WHOAMI" != "uid=0" ] ; then
	echo "You need super user privilege to install."
	exit 1
fi

KEXT_NAME="NDASFamily"
KEXT_INSTALL_DIR="/System/Library/Extensions/$KEXT_NAME.kext"

# -------------------------------------------------------------------------
# Make sure we have the right permissions
# -------------------------------------------------------------------------

chown -R root.wheel $KEXT_INSTALL_DIR
chmod -R go-w $KEXT_INSTALL_DIR

touch /System/Library/Extensions

# -------------------------------------------------------------------------
# Load NDASFamily Driver for immediate use
# -------------------------------------------------------------------------

kextload -b com.ximeta.driver.NDASFamily

# -------------------------------------------------------------------------
# exit successfully.
# -------------------------------------------------------------------------

exit 0
