Web lists-archives.com

Re: pmount could perhaps be of greater utility?




On Sun, May 12, 2019 at 05:52:48PM +1000, Erik Christiansen wrote:
> lmount () {                         # Mount a USB stick at /media/read_stick_label
>    if [ mp=`e2label $1` ] ; then    # if e2label can grok the label.
>       pmount $1 $mp
>    else                             # When that fails, TRY TO
>       pmount -t vfat $1 vfat        # use fs type as mountpoint, for now.
>    fi
> }

A few errors here.

lmount() {
    local mp				# omit this if writing for POSIX sh
    if mp=$(e2label "$1"); then
	pmount "$1" "$mp"
    else
	pmount -t vfat "$1" vfat
    fi
}