-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmnt
executable file
·41 lines (34 loc) · 972 Bytes
/
mnt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
#============================================================================#
# Mount hotplug devices as normal user #
#============================================================================#
# (C) Denis Smirnov <mithraen@freesource.info> http://mithraen.ru/ #
#============================================================================#
HMOUNT=/usr/bin/hmount
PMOUNT=/usr/bin/pmount
PUMOUNT=/usr/bin/pumount
UDISKSCTL=/usr/bin/udisksctl
if [ "$1" = "-u" ]; then
shift
exec umnt "$@"
fi
if [ "$1" = "-l" ] || [ -z "$1" ]; then
shift
exec lsmount "$@"
fi
if [ "$1" = "-h" ]; then
echo "Use: $0 <block device>"
exit -1
fi
DEV="$1"
[ -b "$DEV" ] || [ -b "/dev/$DEV" ] && DEV="/dev/$DEV"
echo "$DEV"
if [ -x $HMOUNT ]; then
$HMOUNT "$DEV"
elif [ -x $PMOUNT ]; then
$PMOUNT "$DEV"
elif [ -x $UDISKSCTL ]; then
$UDISKSCTL mount -b "$DEV"
else
/bin/mount "$DEV"
fi