diff options
Diffstat (limited to 'm')
-rwxr-xr-x | m | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -0,0 +1,17 @@ +#!/bin/sh + +if test `ls /mnt | wc -l` -gt 0 +then + umount /mnt && echo Drive unmounted. + exit 0 +fi + +drv=`lsblk -o name,model | awk /"${1:-U3}"/' {getline; print substr($1, 7)}'` +if test -z "$drv" +then + echo "Drive '${1:-U3}' not found." 1>&2 + exit 1 +fi + +mount /dev/$drv /mnt && echo Drive mounted. && exit 0 +exit 1 |