From 2dccccea8b1c9034811f6f80cae8fd718a3de6a3 Mon Sep 17 00:00:00 2001 From: sneak Date: Wed, 6 May 2020 13:16:52 -0700 Subject: [PATCH] improvements to fixcatalinaimprovements to fixcatalina --- fixcatalina/disable.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/fixcatalina/disable.sh b/fixcatalina/disable.sh index 134134c..f8f1cd0 100644 --- a/fixcatalina/disable.sh +++ b/fixcatalina/disable.sh @@ -162,10 +162,13 @@ TODISABLE+=( \ 'com.apple.telephonyutilities.callservicesd' \ ) -for agent in "${TODISABLE[@]}" -do - mv ./System/Library/LaunchAgents/${agent}.plist ./System/Library/LaunchAgents/${agent}.plist.bak - echo "[OK] Agent ${agent} disabled" +echo Disabling unwanted LaunchAgents... +for agent in "${TODISABLE[@]}"; do + if [[ -e "./System/Library/launchAgents/${agent}.plist" ]]; then + mv "./System/Library/LaunchAgents/${agent}.plist" \ + "./System/Library/LaunchAgents/${agent}.plist.bak" + echo "[OK] Agent ${agent} disabled" + fi done # Daemons to disable @@ -198,8 +201,10 @@ TODISABLE+=( \ 'com.apple.netbiosd' \ ) -for daemon in "${TODISABLE[@]}" -do - mv ./System/Library/LaunchDaemons/${daemon}.plist ./System/Library/LaunchDaemons/${daemon}.plist.bak - echo "[OK] Daemon ${daemon} disabled" +for daemon in "${TODISABLE[@]}" ; do + if [[ -e "./System/Library/LaunchDaemons/${daemon}.plist" ]]; then + mv "./System/Library/LaunchDaemons/${daemon}.plist" \ + "./System/Library/LaunchDaemons/${daemon}.plist.bak" + echo "[OK] Daemon ${daemon} disabled" + fi done