Article 56K7H Mount/Umount mount point from with a script

Mount/Umount mount point from with a script

by
ddenial
from LinuxQuestions.org on (#56K7H)
Hello All

I'm writing a shell script that will mount/umount LUKS encrypted devices into a directory. I'll add many functions to it later.

For now, I'm stuck on two things:
  1. Mounting: You are in one directory, and you mount a partition on to that same directory. Then you will not see any new files in that directory. You have to move out of that directory and come back to that directory to see files. In script, is there a way to 'kind a refresh' that directory so you see the files?
  2. Unmounting: Same thing. You cannot unmount from that directory when it is your current directory. In shell script, how do I unmount, when I execute the shell script from the same directory?
This is the link for my code in GitHub that I newly created. The shell script is 'myluks.sh'

Right now, I have dealt it with some different way, but I'm not its the right way.

Appriciate any comment/suggestions.

Thankslatest?d=yIl2AUoC8zA latest?i=sRUk5uLUhSs:TeEztEVUIYY:F7zBnMy latest?i=sRUk5uLUhSs:TeEztEVUIYY:V_sGLiP latest?d=qj6IDK7rITs latest?i=sRUk5uLUhSs:TeEztEVUIYY:gIN9vFwsRUk5uLUhSs
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments