|
2010-02-19
, 23:36
|
Posts: 83 |
Thanked: 34 times |
Joined on Feb 2010
@ Poole, UK
|
#172
|
|
2010-02-20
, 00:08
|
Posts: 83 |
Thanked: 34 times |
Joined on Feb 2010
@ Poole, UK
|
#173
|
|
2010-02-20
, 10:43
|
Posts: 840 |
Thanked: 823 times |
Joined on Nov 2009
|
#174
|
|
2010-02-20
, 12:46
|
Posts: 83 |
Thanked: 34 times |
Joined on Feb 2010
@ Poole, UK
|
#175
|
~ $ sudo gainroot /home/user # rm cifsmount.sh /home/user # cd MyDocs/ /home/user/MyDocs # mv cifsmount.sh ../
/home/user/MyDocs # cd .. /home/user # ls /home/user # chmod u+x ./cifsmount.sh /home/user # ./cifsmount.sh
|
2010-02-20
, 15:48
|
Posts: 692 |
Thanked: 264 times |
Joined on Dec 2009
|
#176
|
#!/bin/sh #arguments: servername serverip share username password mountpoint #username, password and mountpoint are optional arguments if [ $# -lt 3 ] ; then #Go into "wizard mode" if there are no arguments echo -e "Not enough arguments passed - running wizard" echo -e "Enter the server name:" read servername echo -e "Enter the server IP" read serverip echo -e "Enter the share name or path" read sharename echo -e "Enter a username, or leave blank for anonymous" read username username_orig=$username if [ "${username}" != "" ]; then echo -e "Enter a password" read password fi echo -e "Enter a mount point, or leave blank for automatic" read mountpoint fi #if arguments were passed from the command line, use them: if [ $# -gt 2 ]; then servername=$1 serverip=$2 sharename=$3 username=$4 username_orig=$username password=$5 mountpoint=$6 fi #set default mountpoint if the user didn't enter one if [ "${mountpoint}" = "" ]; then mountpoint="/media/Remote_Filesystems/$servername@$sharename" #make sure the Remote_Filesystems directory exists mountparentdir="/media/Remote_Filesystems" if [ -d $mountparentdir ]; then echo -e "$mountparentdir found." else echo -e "Creating $mountparentdir" mkdir $mountparentdir fi fi #requote variables to escape special characters #servername=$(printf '%q' "$servername") #serverip=$(printf '%q' "$serverip") #sharename=$(printf '%q' "$sharename") #username=$(printf '%q' "$username") #password=$(printf '%q' "$password") #mountpoint=$(printf '%q' "$mountpoint") #check for mountpoint and create it if it doesn't exist if [ -d $mountpoint ]; then echo -e "Mount point already exists - will attempt to use." else echo -e "Creating mountpoint $mountpoint" mkdir $mountpoint fi echo -e "Attempting to mount //$servername/$sharename at $mountpoint" #Run the mount command if [ "${username_orig}" != "" ]; then mount -t cifs //$servername/$sharename $mountpoint -o user=$username,pass=$password,ip=$serverip else mount -t cifs //$servername/$sharename $mountpoint -o ip=$serverip fi #chown mountpoint to user chown -R user $mountpoint echo -e "To unmount this share, run umount $mountpoint as root"
|
2010-02-20
, 16:09
|
Posts: 83 |
Thanked: 34 times |
Joined on Feb 2010
@ Poole, UK
|
#177
|
Sounds like some of you are using older versions of the script. The printf %q issue has been solved. Here is the final, working version again:
|
2010-02-20
, 16:47
|
Posts: 840 |
Thanked: 823 times |
Joined on Nov 2009
|
#178
|
|
2010-02-20
, 17:01
|
Posts: 83 |
Thanked: 34 times |
Joined on Feb 2010
@ Poole, UK
|
#179
|
I don't know which script you used but please try this and tell me what you get.
cat cifsmount.sh | grep cifsmount.sh
try creating the script on the N900 itself perhaps.
|
2010-02-20
, 17:04
|
Posts: 83 |
Thanked: 34 times |
Joined on Feb 2010
@ Poole, UK
|
#180
|
If you try mount share in windows domain and use following syntax:
mount -t cifs //<server>/<path> /<your>/<local>/<path> -o user=<domain>/<user>,pass=<pass>,ip=<ip of server>,direct
You get message: "Mounting the DFS root for domain not implemented yet"
This is without troubles:
mount.cifs //<server>/<path> /<your>/<local>/<path> -ouser=<domain>/<user>,pass=<pass>,ip=<ip of server>,direct
BTW tx Nathan