Issue 81: dirname: invalid option -- 'b' on openmediavault (debian based)
Status:  Fixed
Owner: ----
Closed:  Mar 2013
Reported by arturo.d...@gmail.com, Feb 3, 2013
What steps will reproduce the problem?
1. run the script for first time on OpenMediaVault (debian based)
2.
3.

What is the expected output? What do you see instead?

expected no errors

what i saw:
transmission@nas:/media/fac202db-49d5-4dba-92b0-bee63109d140/bittorrent$ . ./torrentexpander.sh -c
dirname: invalid option -- 'b'
Try `dirname --help' for more information.
touch: cannot touch `/torrentexpander_settings.ini': Permission denied
cat: /torrentexpander_settings.ini: No such file or directory


of course i get the permission denied as it can't touch in the root dir

What version of the product are you using? On what operating system?

version 020
Linux nas 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux
OpenMediaVault 0.1.17

Please provide any additional information below.

After investigating this issue it seems that you have to change the following in your script.

change
PRG="`dirname "$PRG"`/$link"
to
PRG="`dirname -- "$PRG"`/$link"

and change
script_path=`dirname "$PRG"`
to
script_path=`dirname -- "$PRG"`

Then the program started fine.
Feb 3, 2013
#1 arturo.d...@gmail.com
sorry typo in the OMV version its 0.4.17 the latest at this moment
Feb 27, 2013
Project Member #2 addicted...@gmail.com
Thanks for finding this workaround
I'll toy with it this weekend and see if it works on other platforms.

Addictedtoscreens
Mar 3, 2013
Project Member #3 addicted...@gmail.com
Hi Arturo
Fix tested on debian, OS X and a few other OSes and included in release 195
Thank you for providing it

Addictedtoscreens
Status: Fixed