Any chance someone can explain to me why this gives me an error code of 1 on the lines that executes mysides towards the end? I won't proclaim to be the greatest scripter around so if you want to offer suggestions, I'm all ears.
Basically what this script does is a few things...
It executes another policy that installs mysides which is an application I found that lets me automate adding a shortcut to the Finder sidebar.
It mounts a share for the user.
Lastly, now is when it creates the shortcut I mentioned above. On this line is where I get the error. It still does what it is suppose to do so I can't figure out why I'm getting the error message.
This is being run out of Self Service so I get an error message telling me that it cannot install item. Like I said though it is doing what it's suppose to do and if I run it manually in a shell, it works fine without an error. I can't help but think it's a Self Service bug at this point but thought I would ask the experts here because frankly I don't consider myself one when it comes to scripting. Thanks!
#!/bin/sh
Current_User=$(stat -f%Su /dev/console)
Home_Drive=/Volumes/Home
Current_Domain_Group="FakeDomainDomain Users"
Share_Path="smb://fakeserver.fakeserver.com/home2$/$Current_User"
sudo jamf policy -event addHomeDriveFinderToSidebar
mkdir $Home_Drive
chown $Current_User:"$Current_Domain_Group" $Home_Drive
sudo -u $Current_User mount -t smbfs $Share_Path /Volumes/Home
sudo -u $Current_User /usr/local/bin/mysides add $Current_User file://$Home_Drive
exit