A change for the 'mount_shares_locally' script
Posted: Tue Dec 28, 2010 3:29 pm
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
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

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