3 # File ID: 43e64d72-d26d-11de-a010-90e6ba3022ac
8 if [ "$1" = "-l" ]; then
15 [ -z "$2" ] || mountp
=$2
16 [ -d "$mountp/." ] ||
{ mkdir
$mountp ||
{ echo mountusb
: $mountp: Cannot create directory
; exit 1; }; }
17 opts
="-o fmask=0111,uid=sunny,gid=sunny,${tzval}shortname=mixed"
19 mount |
grep /dev
/$dev && {
20 echo mountusb
: Unmounting
/dev
/$dev
21 sudo umount
/dev
/$dev ||
{ echo mountusb
: /dev
/$dev: Cannot unmount
>&2; exit 1; }
25 echo "mountusb: Mounting /dev/$dev on $mountp using \"$opts\""
26 sudo mount
/dev
/$dev $mountp $opts
28 # Check for existing /mntopts file in disk root. That file contains mount
29 # options used on the command line when mounting.
30 if [ -e $mountp/mntopts
-o -e $mountp/MNTOPTS
]; then
31 [ -e $mountp/MNTOPTS
] && mntopts
=MNTOPTS
32 [ -e $mountp/mntopts
] && mntopts
=mntopts
33 opts2
="`cat $mountp/$mntopts`"
34 [ "$opts" = "$opts2" ] && { echo "mountusb: /mntopts contains standard options, remount not necessary"; exit 0; }
39 echo "mountusb: Remount /dev/$dev on $mountp using \"$opts2\""
40 sudo mount
/dev
/$dev $mountp $opts2