[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: quick scripting 'is /P/Q mounted'



Thank you David.
As it happens I have util-linux installed but as with most of Gnu/Linux
there are hundreds of programs I've never used and don't know what do.
Appreciate the heads-up.
Mike

On Tue, Mar 13, 2018 at 08:49:58PM +1100, David wrote:
> On 13 March 2018 at 14:40, Mike McClain <mike.junk.46@att.net> wrote:
> >
> > If my other computer is South40 and I want to mount South40's /docs
> > on my /south40/docs/ directory I can do that. As one script calls
> > another I want to know if I need to mount South40 without
> > $( mount | grep 'south40/docs').
> >
> > Suggestions?
>
> Installing the package util-linux will provide the mountpoint command
> which exits true=0 if its argument is in use as a mountpoint. Example:
>
> $ if mountpoint / ; then echo "exit status is $?" ; fi
> / is a mountpoint
> exit status is 0

--
"Any intelligent fool can make things bigger and more complex...
It takes a touch of genius - and a lot of courage to move in the
opposite direction."                   - Albert Einstein


Reply to: