Skip to main content
Question

beginner using script


Forum|alt.badge.img+4

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

6 replies

Forum|alt.badge.img+21
  • Esteemed Contributor
  • 1043 replies
  • December 1, 2015

I use

open 'smb://server.company.com/share'

and it seems to work ok.


roiegat
Forum|alt.badge.img+16
  • Valued Contributor
  • 412 replies
  • December 1, 2015

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


Forum|alt.badge.img+10
  • Contributor
  • 91 replies
  • December 1, 2015

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`

bentoms
Forum|alt.badge.img+35
  • Legendary Contributor
  • 4331 replies
  • December 1, 2015

I do something similar to what @spotter posted.

Write up here.


Forum|alt.badge.img+16
  • Valued Contributor
  • 1002 replies
  • December 1, 2015

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.


Forum|alt.badge.img+4
  • Author
  • New Contributor
  • 6 replies
  • December 1, 2015

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 *


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings