#!/bin/sh

if [ "$#" -ne 1 ]; then
    echo "Illegal number of parameters"
    exit 1
fi

dir="$1"
if [ ! -d "$dir" ]; then
    echo "Directory does not exist"
    exit 1
fi

filename=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')
file=$(echo "$dir/$filename" | sed 's/\/\//\//g')

touch "$file" || exit 1

echo "File created $file, now deleting..."
rm -f "$file"
