Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 2nd May 2012, 03:18 AM
sea Online
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Confoederatio Helvetica (Swissh)
Age: 34
Posts: 3,377
linuxfedorafirefox
Lightbulb Script: Connect and Debug to Samba NAS

Heyas

As some might have recently, i've had some issues to connect to my NAS.
Figured i made mistakes, but have learned a bit on the road, which the Fedora Community shall benefit from.
At least i hope its helpful

Features:
* Create a credentials file
* Connect to a single share on NAS, using cli.
* Mount all directory to local environment
* Easier debugging, collect data that helps you debugging.
* Change the default variables in the script, so you can just hit enter for your hardcoded default values -> easier re-usage.


For best results, and previous to first execution of the script:
  1. mkdir $HOME/bin
  2. chmod +x sea-samba.sh
  3. mv sea-samba.sh /$HOME/bin
  4. su
  5. yum install cifs-utils samba-client
  6. sea-samba

Once the credentials are created, its quiete easy to use:
Mounting all shares from NAS to local might look similar to this, whilst using sea-samba.sh mn
Code:
		sea's Samba script tool (0.5)
Moutning 192.168.10.110 to /nas
Mounting:	//192.168.10.110/priv    to /nas/priv   	 done   
Mounting:	//192.168.10.110/pub     to /nas/pub    	 done   
Mounting:	//192.168.10.110/TimeMac to /nas/TimeMachine     done   
Mounting:	//192.168.10.110/Picture to /nas/Pictures        done   
Mounting:	//192.168.10.110/Music   to /nas/Music  	 done   
Mounting:	//192.168.10.110/Movies  to /nas/Movies 	 done   
Mounting:	//192.168.10.110/Linux   to /nas/Linux  	 done   
Mounting:	//192.168.10.110/Backups to /nas/Backups         done
Where the 'main' menu looks like:
Code:
Domain=[OGOG] OS=[Unix] Server=[Samba 3.5.6]
Domain=[OGOG] OS=[Unix] Server=[Samba 3.5.6]
		sea's Samba script tool (0.5)
1) Exit
2) Single connection to 1 share on "ocean"
3) Mount all shares on "ocean" to "/nas"
4) Debug 
5) Edit: /etc/samba/smb.cred
6) Edit: /etc/samba/smb.conf
7) Edit: /etc/samba/nas.conf
#?
Have to cut out the "help-command"-part as its too large...
Code:
for arg in $@
do 	if [ "h" = "$arg" ] || [ "-h" = "$arg" ] || [ "--h" = "$arg" ] || [ "--help" = "$arg" ]  || [ "-help" = "$arg" ]
then
cat << EOF
    There are no arguments required.
    Simply edit the variables in the script and/or
    provide the information to create the configuration
    and credential files.
    
    These files will not only ease the use of this script,
    but are also more secure (credential) than using those
    values as plain text (hard coded) in your scripts.
    
    If you need root access, it is suggested to use a term like:
      *)       su -c /path/to/sea-samba
      *)       su -c sea-samba
    
    To perform action right from the command line use these arguments:
      *)	mn	= 	Mount Nas ; Connects to your NAS,
      				if not root a password is required
      *)	co	= 	Connect to Share
      				Reads the shares on the NAS and ask you to
      				which you want to connect.
    
    If you have any ideas to improve this script, 
    find bugs or a solution for them, feel free to send me an
    email to: < erat.simon AT gmail.com > ... with the subject "samba".

EOF
fi
done
Attached Files
File Type: sh sea-samba.sh (10.3 KB, 119 views)
__________________
Laptop: Toshiba satellite p50-a-11 CPU: Intel i7 8*2400 MHz GPU: GeForce GT 745M RAM: 8192 MB Distro: Fedora (Rawhide) DE: Awesome
Text User Interface (TUI) // Windows 8+ & Fedora 20+ Dualboot

Last edited by sea; 16th May 2012 at 10:55 AM.
Reply With Quote
 

Tags
connect, debug, nas, samba, script

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple script problem OR need to debug WPA? Dunhausen Using Fedora 0 17th December 2006 11:00 AM
cannot connect to mysql with php script? shams Using Fedora 3 29th April 2006 02:02 AM
MYSQL won't let me connect from PHP script Sail@ Servers & Networking 13 16th October 2004 01:46 AM


Current GMT-time: 02:03 (Sunday, 21-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat