#!/bin/sh
##############################################################################
#
#  Copyright (c) 2005, Doremi Labs, Inc.
#    All rights reserved.
#
#  Redistribution in source or binary forms, with or without
#  modification, are NOT permitted.
#
#    Doremi Labs, Inc.
#    1020 Chestnut St.
#    Burbank, CA 91506
#    Tel : (818) 562 1101
#    Fax : (818) 562 1109
#
########################################################################d######

# leave a compability mode in case of downgrade (Jira DCPLYR-1939)
if uname -r | grep -Eq "^2"; then
	if [ "${ID_BUS}" == "usb" ]; then
		exec /usr/share/usbmount/usbmount $*
	fi
else
	case $(echo "$DEVPATH" | grep -Eo "(usb|ata)") in
	  usb)
		exec /usr/share/usbmount/usbmount $*
		;;
	  ata)
		exec /usr/share/esatamount/esatamount $*
		;;
	  *)
		;;
	esac
	# EINVAL
	exit 22
fi
