Posted on 12-01-2015 06:02 AM
Hello everyone,
I just want to ask question.
mounting network drive using script through terminal.
let say I want to mount a network drive named "\jamfsoftwaresoftware est"
how to I mount that using a script?
when you use "connect to server", they automatically connects to network drive and shows the content of the network drive.
example, using smb://jamfsoftware/software/test to connect.
I just want to make same thing happening using script.
I tried searching through internet, but I couldn't find good coding for it.
Could you guys let me know how if possible?
Thank you
Posted on 12-01-2015 06:36 AM
I use
open 'smb://server.company.com/share'
and it seems to work ok.
Posted on 12-01-2015 06:36 AM
First you need to create a directory for it:
mdkir /tmp/test
then mount it
mount -t smbfs //user:pass@jamfsoftware/software/test /tmp/test
This mounts it to the tmp/test folder
Posted on 12-01-2015 10:19 AM
you can try something like this...
#!/bin/sh
mountShare=`/usr/bin/osascript > /dev/null << EOT
tell application "Finder"
activate
mount volume "smb://jamfsoftware/software/test"
end tell
EOT`
Posted on 12-01-2015 10:21 AM
Posted on 12-01-2015 12:17 PM
Likwise I use something similar to @spotter as well, getting the Finder to do it removes a lot of the complications especially if your running as root or different user from a script or policy.
Posted on 12-01-2015 02:48 PM
i'm just trying to get part of it working using different ways of doing this.
I made Alias folder (network folder) to desktop.
when I try to access the folder using CD, it said "no such file or directory"
is there way I could access network folder through terminal?
when I do LS command, it shows up in the list, but when I actually try to go, it doesn't....
i'm trying to copy data from network drive to desktop using terminal commands *