#!/bin/bash

action="$1"
dev="$2"
fstype="$3"
label="$4"

if [ "$action" = "add" -a "$dev" != "" ]; then
	if [ "$fstype" = "ntfs" ]; then
		pmount -t ntfs-3g --fmask 0000 --dmask 0000 -c utf8 /dev/$dev ${label:+$label}
	else
		pmount --fmask 0000 --dmask 0000 -c utf8 /dev/$dev ${label:+$label}
	fi
elif [ "$action" = "remove" -a "$dev" != "" ]; then
	pumount -l /dev/$dev
fi
