Skip to content

Instantly share code, notes, and snippets.

@smallstyle
Created May 4, 2011 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save smallstyle/955023 to your computer and use it in GitHub Desktop.
Save smallstyle/955023 to your computer and use it in GitHub Desktop.
pogoplugfs initscript
#!/bin/sh
[ "$IFACE" != "lo" ] || exit 0
mount|while read fs on mp type fstype opts
do
if echo $fs | grep -q "gvfs-fuse-daemon"; then
username=`echo $opts | sed -E "s/.*user=([^,]+).*\)/\1/g"`
if [ "$username" ]; then
sudo -u "$username" sh -c "pogoplugfs --mountpoint /media/pogoplug &"
fi
fi
done
#!/bin/sh
[ "$IFACE" != "lo" ] || exit 0
mount | while read fs on mp type fstype opts
do
if [ "$mp" = "/media/pogoplug" ];then
umount /media/pogoplug
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment