#!/bin/sh
# install_msb:
# A script to install the ModeSwitch loginwindow bundle
#
# Scott Vail
# 10/22/1997

if [ `whoami` != "root" ]; then 
   echo "You must be root to install this package."
   exit 1
fi

name="ModeSwitch"
package="$name.tar"
lwdir="/usr/lib/NextStep/loginwindow.app"
dir=`dirname $0`

if [ $dir = "." ]; then
    dir=`pwd`
fi

if [ ! -f $dir/$package ]; then
    echo "Couldn't find $dir/$package, aborting!"
    exit 1
fi

echo ""
echo "Changing directory to: $lwdir"
cd $lwdir

echo ""
echo "Unarchiving: $package"
/usr/bin/gnutar xf $dir/$package || exit 1
echo "Done!"

echo ""
echo "Setting defaults database"
/usr/bin/defaults write loginwindow LoginUIBundle $lwdir/$name.bundle
echo "Done!"

echo ""
echo "Now do the following:"
echo ""
echo "1. Log out."
echo "2. Type \"exit\" in the username field of the loginwindow and"
echo "   press the 'return' key."
echo "3. Have fun!"
echo ""

exit 0

