#!/bin/sh

MOUNT_DIRECTORY=$1

# In case it doesn't exist
cd $MOUNT_DIRECTORY || { echo "" && exit 1; }
# Find next available mountpoint
i=0
while [ -d device-$i ]; do (( i++ )); done;
# Make new directory and return the unique identifier
mkdir device-$i && echo "device-$i";
