Hello,
If you use the 'mount_shares_locally' script to, ahum, mount your shares locally, all the folder names will start with an upper case letter, whereas the shares themself do not. This is a bit annoying (lots of typos). I saw that the script uses the mySQL database 'comment' column. I've changed the script to use the 'path' column and used 'basename' to remove any leading directory components. This way the locally mounted share will have the exact same name.
Now I don't know much about Linux shell scripting and don't know if this will work under all circumstances. I've tested it on my system and it works fine, but would appreciate if someone with a better knowledge of these things would take a look at it....
The only line in the script that changed is the one starting with 'mysql...':
Code:
mysql -u root -phda -e "select path from shares" hda_production | grep -v "^path$" | xargs -n 1 basename | xargs -d "\n" mkdir -p
Richard
A change for the 'mount_shares_locally' script
- NeverSimple
- Posts: 114
- Joined: Sat Aug 21, 2010 4:26 pm
- Location: The Netherlands
Re: A change for the 'mount_shares_locally' script
Hmmm...this seems dangerous. Messing with the production database could have catastrophic results if its corrupted. This database hold all HDA settings and could bring down the entire system if damaged.
Is there a reason why to not use the dashboard to create shares and change the path there? Maybe this should be a feature request so we can make it easy for all users. There are some who are not comfortable with command line.
Is there a reason why to not use the dashboard to create shares and change the path there? Maybe this should be a feature request so we can make it easy for all users. There are some who are not comfortable with command line.
ßîgƒσστ65
Applications Manager
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2
Applications Manager
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2
- NeverSimple
- Posts: 114
- Joined: Sat Aug 21, 2010 4:26 pm
- Location: The Netherlands
Re: A change for the 'mount_shares_locally' script
Really? Why? Just reading some values from it, just like the original script. (Don't know who wrote that). The only thing I wanted to change is to make the original share names and the 'locally mounted share names' the same.Hmmm...this seems dangerous.
I think you misunderstand the reason for the script. It's not for creating shares but for mounting them on the server itself. That can be used if you want an installed application to write to the share and you are using greyhole. Writing directly to /var/hda/files/sharename is not recommended.
This can't be done through the dashboard.
Or maybe I don't understand what you mean.
Richard
Re: A change for the 'mount_shares_locally' script
The directories used to mount local shares are the shares names, not the name of the folder holding the data.
This is the same thing when you mount those shares remotely.
For example, if you have a Music share in /var/hda/files/music, and a Potato share in /var/hda/files/whatever, and you connect remotely, you'll see Music & Potato shares, not music & whatever shares.
Thus why the mount shares locally script re-used the share name, not the basename of their path, to mount the shares.
This is the same thing when you mount those shares remotely.
For example, if you have a Music share in /var/hda/files/music, and a Potato share in /var/hda/files/whatever, and you connect remotely, you'll see Music & Potato shares, not music & whatever shares.
Thus why the mount shares locally script re-used the share name, not the basename of their path, to mount the shares.
- Guillaume Boudreau
- NeverSimple
- Posts: 114
- Joined: Sat Aug 21, 2010 4:26 pm
- Location: The Netherlands
Re: A change for the 'mount_shares_locally' script
Ahh, that sounds reasonable . I was working on setting up a new server and moving a LOT of data from the old one, only using the terminal. Then you only see directory names, not share names, hence my confusion. But i guess (and hope..) that is not the way I will be working with my server in the future.
Now if only W7 could stop trying to be smart by showing shares with all uppercase (like abbreviations - HAT) as all lowercase (hat) I would be even happier... My Ubuntu desktop shows the sharenames as I entered them.
Richard
Now if only W7 could stop trying to be smart by showing shares with all uppercase (like abbreviations - HAT) as all lowercase (hat) I would be even happier... My Ubuntu desktop shows the sharenames as I entered them.
Richard
Re: A change for the 'mount_shares_locally' script
Ah...makes sense. Sorry missed the read from db part.
ßîgƒσστ65
Applications Manager
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2
Applications Manager
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2
Who is online
Users browsing this forum: No registered users and 22 guests