#!/bin/sh

pt="/mnt/memstick";
if [ $# -gt 0 ] ; then
	pt="$1";
fi;

case "`uname`" in
	CYGWIN*|Darwin)
		until [ -d "$pt" ] ; do
			printf "\\a";
			sleep 1;
		done
		exit 0;
		;;
	*)
		mount | grep -q "$pt"
		if [ $? -gt 0 ] ; then
			mount "$pt";
			if [ $? -gt 0 ] ; then
				echo "Please insert the memory stick...";
				until mount "$pt" &> /dev/null ; do
					printf "\\a";
					sleep 1;
				done
			fi;
		fi;
		;;
esac
