Hello
We have started to enroll our macbooks for our employees without adminrights. Yes we have the privilege access configured in jamf connect, but don't want use it for everyone :)
So i started to configure what is necessary for our employees that they can work without adminrights.
So far so good. Now i am actually helpless with this one problem about creating a symlink via jamf pro policy after installation of Visual Studio code.
What i need is:
A symlink in the directory /usr/local/bin/code which points to /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code
So i am able to create it, but it isnt working. Checking it on a testmachine the symlink shows me in the "get info" as "Original" the path /usr/local/bin/code
instead of
/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code
So its not the first symlink i create but its the first in this location /usr/local/bin/code so maybe i am doing something wrong.
I am using this short script
#!/bin/bash
set -x
# Get the current user's home directory
loggedInUser=$(stat -f "%Su" /dev/console)
USER_HOME="/Users/$loggedInUser"
open -a /Applications/Visual\\ Studio\\ Code.app
# Set symlink
ln -snf "$USER_HOME/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" /usr/local/bin/code
exit 0
Running the command locally on a machine:
ln -snf "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" /usr/local/bin/code is working fine, but i am not able to do this via jamf policy and script
Somehow an idea what i am doing wrong here?
I appreciate for every tipp, suggestion and help
THX in Advance
J