32 lines
1.9 KiB
Bash
32 lines
1.9 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
if [ -d /Applications ] && [ -d /System ]; then
|
|
### Enable automated updates on macOS
|
|
if [ -f "$HOME/Library/LaunchDaemons/com.apple.automatedupdates.plist" ] && [ ! -f "/Library/LaunchDaemons/com.apple.automatedupdates.plist" ]; then
|
|
sudo mkdir -p /Library/LaunchDaemons
|
|
sudo cp -f "$HOME/Library/LaunchDaemons/com.apple.automatedupdates.plist" "/Library/LaunchDaemons/com.apple.automatedupdates.plist"
|
|
sudo launchctl load "/Library/LaunchDaemons/com.apple.automatedupdates.plist"
|
|
fi
|
|
|
|
### Enable CloudFlare WARP credentials auto-populate (since file is deleted when not managed with MDM)
|
|
if [ -f "$HOME/Library/LaunchDaemons/com.cloudflare.warp.plist" ] && [ ! -f "/Library/LaunchDaemons/com.cloudflare.warp.plist" ]; then
|
|
sudo mkdir -p /Library/LaunchDaemons
|
|
sudo cp -f "$HOME/Library/LaunchDaemons/com.cloudflare.warp.plist" '/Library/LaunchDaemons/com.cloudflare.warp.plist'
|
|
sudo launchctl load "/Library/LaunchDaemons/com.cloudflare.warp.plist"
|
|
fi
|
|
|
|
### Enable Rclone mounts
|
|
if [ -f "$HOME/Library/LaunchDaemons/rclone.private.plist" ] && [ ! -f "/Library/LaunchDaemons/rclone.private.plist" ]; then
|
|
sudo mkdir -p /Library/LaunchDaemons
|
|
sudo cp -f "$HOME/Library/LaunchDaemons/rclone.private.plist" '/Library/LaunchDaemons/rclone.private.plist'
|
|
sudo launchctl load '/Library/LaunchDaemons/rclone.private.plist'
|
|
fi
|
|
if [ -f "$HOME/Library/LaunchDaemons/rclone.public.plist" ] && [ ! -f "/Library/LaunchDaemons/rclone.public.plist" ]; then
|
|
sudo mkdir -p /Library/LaunchDaemons
|
|
sudo cp -f "$HOME/Library/LaunchDaemons/rclone.public.plist" '/Library/LaunchDaemons/rclone.public.plist'
|
|
sudo launchctl load '/Library/LaunchDaemons/rclone.public.plist'
|
|
fi
|
|
if [ -f "$HOME/Library/LaunchDaemons/rclone.user.plist" ]; then
|
|
launchctl load "$HOME/Library/LaunchDaemons/rclone.user.plist"
|
|
fi
|
|
fi
|