mirror of
https://github.com/google/santa.git
synced 2026-01-15 01:08:12 -05:00
37 lines
1.1 KiB
Bash
37 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
# Load the kernel extension, santad, sync client
|
|
# If a user is logged in, also load the GUI agent.
|
|
# If the target volume is not /, do nothing
|
|
|
|
[[ $3 != "/" ]] && exit 0
|
|
|
|
# Restart syslogd to pick up ASL configuration change
|
|
/usr/bin/killall -HUP syslogd
|
|
|
|
# Create hopefully useful symlink for santactl
|
|
mkdir -p /usr/local/bin
|
|
/bin/ln -sf /Applications/Santa.app/Contents/MacOS/santactl /usr/local/bin/santactl
|
|
|
|
if [ $(uname -r | cut -d'.' -f1) -ge 19 ]; then
|
|
# Running on 10.15+
|
|
echo "Santa postinstall: running on 10.15+"
|
|
/bin/rm -rf /Library/Extensions/santa-driver.kext
|
|
/bin/rm -f /Library/LaunchDaemons/com.google.santad.plist
|
|
else
|
|
# Running on <10.15
|
|
/bin/launchctl load -w /Library/LaunchDaemons/com.google.santad.plist
|
|
fi
|
|
|
|
# Load the bundle service
|
|
/bin/launchctl load -w /Library/LaunchDaemons/com.google.santa.bundleservice.plist
|
|
|
|
user=$(/usr/bin/stat -f '%u' /dev/console)
|
|
if [[ -z "$user" ]]; then
|
|
/Applications/Santa.app/Contents/MacOS/Santa --load-system-extension
|
|
exit 0
|
|
fi
|
|
/bin/launchctl asuser ${user} /bin/launchctl load /Library/LaunchAgents/com.google.santa.plist
|
|
|
|
exit 0
|