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:
- mkdir $HOME/bin
- chmod +x sea-samba.sh
- mv sea-samba.sh /$HOME/bin
- su
- yum install cifs-utils samba-client
- 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