automouter samba
I need a script or some sort of software that would be able to check the available shares on a specific target machine (with smbclient or smbmount) make directories for each share in a specific folder then loop through and mount all available shares. I need this script because I have a scpecific computer that constantly changes its shares and I am tired of manualy mounting each needed share. If someone could point me in the right direction I would be greatful.
I can get a list of shares in the following table format. <tab>Share_name<spaces>"Disk"<newline> a Disk asdas Disk lakjsh Disk l;akjsd Disk replace <tab> with a tab character and <spaces> with spaces. If someone could tell me how to extract the share name by it self from maybe 10 lines (with a loop) I also would like to set a variable equal to one of the share names and mount it then loop through all the lines to complete the mounting. This should end up to be a simple bash script or sh script that could be run at the start of kde! |
bump*
anyone? can someone show me how to just extract the names from the table? |
well I compiled the solution on my own using some online scripts. I do not know bash so this might not be optimal but it works
Code:
|
Excellent work! I only just saw this thread which is weird but hey, great job working it out and thank you for taking the time to post it for others :)
|
I too just saw this, & echo the 2 compliments.
I do think your script could be way simpler, or else I don't understand what you are trying to do. Assuming your "list of shares in the following table format" is in a file (SHARES) & the command that will mount a share is smbmount //server/share /mnt/server/share -o guest where "share" is the current share, then would this not work: Code:
#!/bin/bash |
All times are GMT -5. The time now is 07:21 AM. |