Re: New mounting script

469 views
Skip to first unread message

Jonathan K. Bullard

unread,
Oct 14, 2012, 4:55:45 PM10/14/12
to tunnelbli...@googlegroups.com
Thanks! I will put a link to your post in the writeup for the existing script.

On Sun, Oct 14, 2012 at 4:08 PM, Denis Loginov wrote:

Hi,


I've been trying to auto-mount CIFS/SMB shares using connected.sh but the script failed. Then I started this script manually from Terminal, and it asked me for the password for my CIFS account, even though I previously saved in in Keychain.

Turns out, to be able to access Keychain, we need to use Apple Scripts. Here's a way to do so:


#  connected.sh


su <USERNAME> -c '

osascript -e "mount volume \"smb://<DOMAIN>\<USER>@<SERVER>/<SHARE>\""

'

# open /Volumes/<NAME>


Note that there is no need to use mkdir or specify a mount point, as the Mac will automatically do that for us.


Cheers!

--
You received this message because you are subscribed to the Google Groups "tunnelblick-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/tunnelblick-discuss/-/5IE9SUUXJRQJ.
To post to this group, send email to tunnelbli...@googlegroups.com.
To unsubscribe from this group, send email to tunnelblick-dis...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tunnelblick-discuss?hl=en.

pdegi...@bluebayautomation.com

unread,
Jun 8, 2016, 5:43:15 PM6/8/16
to tunnelblick-discuss
I know that this post is quite old, but I'm having trouble trying to implement it.  

mount volume script will run without issues and the VPN connects.  However, the volume does not actually mount.  I tried using "open location" instead of "mount volume" and it will work fine.  If I write a quick script in Script Editor, mount volume works as expected.  It just doesn't seem to work when executed from connected.sh.  

Does anyone have any suggestions?
To unsubscribe from this group, send email to tunnelblick-discuss+unsub...@googlegroups.com.

jkbull...gmail.com

unread,
Jun 8, 2016, 6:00:20 PM6/8/16
to tunnelblick-discuss, pdegi...@bluebayautomation.com
I can only offer a couple of general suggestions:

1. Add lines like
echo "something" >> /tmp/connected.sh.log.txt
to your connected.sh script to get a log of what happens with each command in the script.

2. Check the error status of each command in the script by using the "$?" bash construct.

3. Remember that the script runs as root, not as the user. The username is available in the Environment Variables.
Reply all
Reply to author
Forward
0 new messages