Open file explorer at mount point from bash script

I’m currently mounting my restic repository from within a bash script without any issues, but I would like to be able to have my file explorer (KDE Dolphin) open up automatically to that mount point once the repo is mounted.

I’m having troubles figuring out how to do so.

Can anyone offer some help on how I can go about doing this?

Thanks

Can’t you just run dolphin /path/to/the/mount/point after you mounted the repository using restic in your script? I don’t understand what’s unclear or what you are stuck on.

I tried the following:

restic --password-file <( gpg --decrypt “$FILE”) mount -r “$usb_path” /tmp/"$mount_point"
dolphin /tmp/"$mount_point"

The repository mounts fine at /tmp/, but dolphin doesn’t launch until I do a “Ctrl-c” to unmount the repository. I’m not sure how to get the script file to proceed onto calling dolphin while the restic mount command is still active.

Placing

&

at the end of the line with restic mount seemed to do the trick.

Yes, because restic stays in the foreground. You need the & as you found out yourself :slight_smile:

The only issue now is that Ctrl-c no longer works to unmount the repo. Is that because restic is no longer running in the foreground?

Ctrl-c is always sent to the process runnning in the foreground. You have to call fg to move restic back into the foreground.

1 Like

Yes, that was the trick.

Thanks!