1

I have a bash script that mounts a fuse filesystem created with the backup tool borg. Mounting the filesystem requires a passphrase. The mount command of borg allows to read the passphrase from an export in my shell script. So the first two lines of my script are something like

#!/bin/bash
export BORG_PASSPHRASE='mypassphrase'

Then I mount the filesystem with the mount command

borg mount user@server:/mntpoint::backup_repository /localmntpoint

The script runs perfectly fine. However, I would like to create a standalone app which runs this script. So I called the script Borg and created a directory Borg.app which contains Contents and MacOS as subdirectories and in MacOS I put the Borg shell script. This appears to be the usual way of turning a shell script into a clickable application. I am aware that one can click the shell script itself and a terminal will fire up and execute the script. I prefer the other option.

Unfortunately nothing happens upon clicking my Borg.app. I suspect the issue is the export command at the beginning which is somehow missed by the mount command in this setup.

Any help in resolving this is greatly appreciated.

1

Make sure that

  • the shell script within Borg.app is executable (chmod +x ...)
  • all the files within Borg.app are accessible by the current user
  • any command called from the script is called with the full path specified (especially for things stored in /usr/local/bin and similar non-default places)
  • Many thanks Patrick for your answer. The app was already executable. Strange enough, if I run open /Applications/Borg.app in a terminal, it worked, while clicking the app in the Finder did not do anything. – 220284 Dec 10 '19 at 15:57
  • @220284 Can you add the full path to borg and try again? – nohillside Dec 10 '19 at 16:19
  • Problem solved, many thanks! The issue was an incomplete path to the borg command. Replacing borg with /usr/local/bin/borg does the trick. – 220284 Dec 10 '19 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .