summaryrefslogtreecommitdiff
path: root/filesystems/simple-mtpfs/files/special_simple-mtpfs.in
blob: 7f45b8649e53a797d8391ba16c70865f32000b17 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
#
# Intended for use with /etc/auto_master containing
# /mtp		-simple-mtpfs	-allow_other
#

out=$(%%PREFIX%%/bin/simple-mtpfs --list-devices)
[ $? -eq 0 ] || exit 1

if [ $# -eq 0 ]; then
	echo "$out" | sed 's/[^:]*: //' | sort -u
	exit 0
fi

devno=$(echo "$out" | (fgrep "$1" || echo 0) | sed 's/:.*//')
[ $devno -gt 0 ] || exit 1

echo "/ -fstype=none,--device=$devno,mountprog=%%PREFIX%%/bin/simple-mtpfs :none"