diff options
author | John Ankarström <john@ankarstrom.se> | 2020-10-31 00:06:23 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2020-11-15 22:00:33 +0100 |
commit | c1acfc730a50fe8049742ac0c2465db631262aac (patch) | |
tree | 60d49358963deaaaf4c221d9c3907e616f73b564 | |
parent | f9c205bc1637004483d5e3f3734820f1a65a0eda (diff) | |
download | alpine-c1acfc730a50fe8049742ac0c2465db631262aac.tar.gz |
Add 'm' mount tool
-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 |