#!/bin/sh

#echo "DEBUG" > /dev/console

if [ $ACTION == "add" ]
then
	echo "DEBUG" > /dev/console
	mkdir /media/$MDEV
	mount /dev/$MDEV -t ext4 /media/$MDEV
	cp /media/$MDEV/*.jpg /www/upload/files/
elif [ $ACTION == "remove" ]
then
	rm /www/upload/files/*.jpg
	umount /media/$MDEV
	rmdir /media/$MDEV
fi
