Thanks for all your input!
Our solution:
#!/bin/bash
ID1="34B4BD85-3422-4B3E-A48E-09A987113718"
ID2="93350992-13C1-42AE-916A-4F3543E7E29C"
CHECK1=/usr/bin/profiles -L -P | grep $ID1 | wc -l
CHECK2=/usr/bin/profiles -L -P | grep $ID2 | wc -l
## CHECK OFFICE Tunnel ALL
if [ $CHECK1 -eq 0 ]
then
echo "No Certificate installed for Office Access Tunnel All"
EXIT1="1"
else
echo "Certificate for Office Access Tunnel All are installed"
EXIT1="0"
fi
if [ $CHECK2 -eq 0 ]
then
echo "No Certificate installed for Office Access"
EXIT2="1"
else
echo "Certificate for Access are installed"
EXIT2="0"
fi
if [ $EXIT1 -eq 0 ]
then
if [ $EXIT2 -eq 0 ]
then
jamf policy -event CNSO
fi
else
exit 0
fi
This (jamf policy -event CNSO) triggers the policy, that sets our Network Service order, the way we want it:
https://jamfnation.jamfsoftware.com/discussion.html?id=11189
Best regards,
Kevin