Hey guys,
We're working on an automatic policy push of Python3 to people in the company. This can happen even once, but needs to happen to all the people.
This is the current script:
!/bin/bash
jamf policy -event PythonTrigger
-u $3 [ -f ~/.bash_profile ] && sed -i '' -e 's/(^./Python.framework/Versions/.$)/#1/' ~/.bash_profile && echo "Success updating .bash_profile" || echo "Failed updating .bash_profile"
-u $3 [ -f ~/.zprofile ] && sed -i '' -e 's/(^./Python.framework/Versions/.$)/#1/' ~/.zprofile && echo "Success updating .bash_profile"
-u $3 [ -f ~/.bashrc ] && sed -i '' -e 's/(^./Python.framework/Versions/.$)/#1/' ~/.bashrc && echo "Success updating .bash_profile"
Now, the script is running on a policy calling for the trigger. Another policy, the one with the package, has the PythonTrigger.
The policy that extracts the Python package runs successfully, and Python is installed in Applications.
However, after that part, the rest of the policy fails. Python should be at version 3.8.2 per the package, but when running Python3 at the terminal, it doesn't appear to be updated.
Would appreciate any input on the script/process!
