This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Deploy ColorSync Profiles
Rod Christiansen edited this page Jan 10, 2019
·
1 revision
An example munkipkg that maintains a consistent ColorSync folder in a local student library with an outset login-privileged-every
script.
/Users/Shared/ColorSyncProfiles/my-awesome-icc-files
#!/bin/bash
# Create login-privileged-every outset script to move files without clobbering never logged in library
rm -rf /usr/local/outset/login-privileged-every/StudentColorSync.sh
touch /usr/local/outset/login-privileged-every/StudentColorSync.sh
echo "#!/bin/bash
if [[ \`logname\` == student ]]; then
# Clear ColorSync Folder
rm -rf /Users/student/Library/ColorSync/*.icc
rm -rf /Users/student/Library/ColorSync/Profiles/*.icc
mkdir /Users/student/Library/ColorSync/Profiles
# Copy color sync profiles from actual package we build
sudo /usr/bin/ditto /Users/Shared/ColorSyncProfiles/* /Users/student/Library/ColorSync/Profiles/
# Copy color sync profiles from Canon and Epson drivers source in the top level library
# so if driver gets an update so will student level color sync profiles in the student folder
sudo /usr/bin/ditto /Library/Printers/Canon/BJPrinter/Resources/ICCProfiles/PRO2000.canonicc/Contents/Resources/* /Users/student/Library/ColorSync/Profiles/
sudo /usr/bin/ditto /Library/Printers/EPSON/InkjetPrinter2/ICCProfiles/Epson\ Stylus\ Pro\ 4900_4910.profiles/Contents/Resources/* /Users/student/Library/ColorSync/Profiles/
# Keep good permissions for student
sudo /usr/sbin/chown -R student:staff /Users/student/Library/ColorSync
fi" >> /usr/local/outset/login-privileged-every/StudentColorSync.sh
# Put alias to color sync folder in the desktop
if [[ `defaults read /Library/Preferences/com.apple.RemoteDesktop Text2 | grep "Photo"` ]]; then
if [[ ! `ls /Users/student/Desktop/ | grep ColorSync` ]]; then
sudo ln -s /Users/student/Library/ColorSync /Users/student/Desktop/ColorSync
fi
fi
# Set permissions so student account can move files
sudo chown -R student:staff /Users/Shared/ColorSyncProfiles
# Hide folder in Shared so users don't meddle with it
sudo chflags hidden /Users/Shared/ColorSyncProfiles
# Keep outset permissions happy
sudo chown root:wheel /usr/local/outset;
sudo chmod -R 755 /usr/local/outset/login-p*
exit 0