share connect

Aguiness
New Contributor III

Hi i am using a shareconnect script by david ackland to mount smb shares, the script runs ok and i am testing with a smb test share, i am not using AD to authenticate just the users local login
the script runs i get the authentication window i put in the credentials and it looks like it should work but it does not mount the share on the desktop if i manually do it using connect to server it works ok does anyone have any ideas

he has a youtube video and i have followed it as instructed

!/bin/bash

Created by David Acland - Amsys

Use at your own risk. Amsys will accept

no responsibility for loss or damage

caused by this script.

username="$3" if [ -z "$username" ]; then # Checks if the variable is empty (user running script from Self Service) username="$USER" fi echo "User: $username"
protocol="$4" # This is the protocol to connect with (afp | smb) echo "Protocol: $4"
serverName="$5" # This is the address of the server, e.g. my.fileserver.com echo "Server: $5"
shareName="$6" # This is the name of the share to mount echo "Sharename: $6"
group="$7" # This is the name of the group the user needs to be a member of to mount the share echo "Group: $7"

Check that the user is in the necessary group

groupCheck=dseditgroup -o checkmember -m $username "$group" | grep -c "yes" if [ "${groupCheck}" -ne 1 ]; then exit 1 fi

Mount the drive

mount_script=`/usr/bin/osascript > /dev/null << EOT tell application "Finder" activate mount volume "$protocol://${serverName}/${shareName}" end tell
EOT`

exit 0

0 REPLIES 0