I've noticed after installing Citrix Receiver the default setting is to have it automatically check for updates, and the popups to update are really persistent. I'm trying to build a script to change this setting, and I'm close but I'm running into some issues.
The script I have is:
#!/bin/sh
#kill Citrix Receiver if running
pkill Citrix Receiver
#get loggedinuser
loggedInUser="$(/bin/ls -la /dev/console | /usr/bin/cut -d " " -f 4)"
#make sure labuser logged in
if [[ $loggedInUser != "labuser" ]]
then
echo "labuser not logged in, please re-run later"
exit 1
else
echo "labuser logged in"
fi
#confirm plist exists where this setting can be entered
if [ ! -f /Users/"$loggedInUser"/Library/Preferences/com.citrix.receiver.nomas.plist ]
then
echo "Plist not found, Citrix not installed or in error."
exit 1
else
echo "Plist exists, continuing..."
fi
plistContents="$(defaults read com.citrix.receiver.nomas)"
autoUpdateSetting="$(defaults read com.citrix.receiver.nomas AutoUpdateState)"
if [[ "$plistContents" == *"AutoUpdateState"* ]] #autoupdatesetting exists
then
if [[ $autoUpdateSetting != "Disabled" ]] #autoupdatesetting is not set to Disabled
then
defaults write com.citrix.receiver.nomas AutoUpdateState -string Disabled
echo "${autoUpdateSetting} set"
else
echo "${autoUpdateSetting} already set"
fi
else
defaults write com.citrix.receiver.nomas AutoUpdateState -string Disabled
echo "${autoUpdateSetting} set"
fi
exit 0
If I just run this script on a computer it works fine, but I'm running into issues doing it through JAMF. I'm able to get through the part where it confirms the PLIST exists, but then when it tries to define the plistContents variable it says "Domain com.citrix.receiver.nomas does not exist." Which is frustrating since I confirmed that it existed before running that command (and it definitely does exist).
I also tried specifying the full path of the PLIST (so defaults write /Users/"$loggedInUser"/Library/Preferences/com.citrix.receiver.nomas) for the "defaults read" and "defaults write" commands and it seemed to work, though when I run "defaults read com.citrix.receiver.nomas" in terminal (which used to come up with the contents of that file) it now just gives the "Domain com.citrix.receiver.nomas does not exist" error message. And when I open Citrix, it's still set to automatically check for updates.
Any ideas about what I might be doing wrong?
Thanks