Skip to content

Instantly share code, notes, and snippets.

@legendtang
Last active October 16, 2015 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save legendtang/98c5c73d1b58398912fb to your computer and use it in GitHub Desktop.
Save legendtang/98c5c73d1b58398912fb to your computer and use it in GitHub Desktop.
For ufsd only, not designed for NTFS-3g
#!/bin/sh
case "$ACTION" in
add)
for i in $(ls /dev/ | grep 'sd[a-z][1-9]')
do
mkdir -p /mnt/$i
mount -t ufsd -o iocharset=utf8,rw /dev/$i /mnt/$i
if test "$?" -ne 0 ;then
mount -t ufsd -o rw /dev/$i /mnt/$i
fi
done
;;
remove)
MOUNT=`mount | grep -o '/mnt/sd[a-z][1-9]'`
for i in $MOUNT
do
umount $i
done
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment