#!/bin/sh

# Determine whether root or a mortal user is using /usr/bin/eject
# If root, just /usr/bin/eject_root
# If mortal user, sudo to eject

if [ -x /usr/bin/id ]; then
   if test `/usr/bin/id -u` != 0; then
      if [ -x /usr/pkg/bin/sudo ]; then
         /usr/pkg/bin/sudo /usr/bin/eject $*
         exit $?
      fi
   fi
fi

/usr/bin/eject_root $*
exit $?

