From be354a5de4526632e9cd022f45e5118df31e550e Mon Sep 17 00:00:00 2001 From: Mario Panighetti Date: Mon, 23 Sep 2019 17:01:50 -0700 Subject: [PATCH 1/2] added explicit unload of helper LaunchDaemon - added explicit unload of helper LaunchDaemon (fixes an issue where the process persists if the enforced updates do not require a restart, e.g. Safari #30) --- payload/Library/Scripts/install_or_defer.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/payload/Library/Scripts/install_or_defer.sh b/payload/Library/Scripts/install_or_defer.sh index 09725ef..8f697be 100644 --- a/payload/Library/Scripts/install_or_defer.sh +++ b/payload/Library/Scripts/install_or_defer.sh @@ -13,8 +13,8 @@ # restarts automatically. # Authors: Elliot Jordan and Mario Panighetti # Created: 2017-03-09 -# Last Modified: 2019-07-23 -# Version: 2.3.1 +# Last Modified: 2019-09-23 +# Version: 2.3.2 # ### @@ -156,7 +156,8 @@ EOF # Create the LaunchDaemon that we'll use to show the persistent jamfHelper # messages. - cat << EOF > "/private/tmp/${BUNDLE_ID}_helper.plist" + HELPER_LD="/private/tmp/${BUNDLE_ID}_helper.plist" + cat << EOF > "$HELPER_LD" @@ -176,7 +177,7 @@ EOF # Load the LaunchDaemon to show the jamfHelper message. echo "Displaying \"run updates\" message..." killall jamfHelper 2>/dev/null - launchctl load -w "/private/tmp/${BUNDLE_ID}_helper.plist" + launchctl load -w "$HELPER_LD" # After specified delay, apply updates. echo "Waiting $(( UPDATE_DELAY / 60 )) minutes before automatically applying updates..." @@ -217,8 +218,9 @@ clean_up () { defaults delete "$PLIST" AppleSoftwareUpdatesForcedAfter 2>/dev/null defaults delete "$PLIST" AppleSoftwareUpdatesDeferredUntil 2>/dev/null - echo "Cleaning up main script and LaunchDaemon..." + echo "Cleaning up main script and LaunchDaemons..." mv "/Library/LaunchDaemons/$BUNDLE_ID.plist" "/private/tmp/$BUNDLE_ID.plist" + launchctl unload -w "$HELPER_LD" mv "$0" "/private/tmp/" } From 0a88ecd75f1c4bc42e755d7a85c53c340c90c5da Mon Sep 17 00:00:00 2001 From: Mario Panighetti Date: Mon, 23 Sep 2019 17:02:20 -0700 Subject: [PATCH 2/2] iterated build version --- build-info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-info.plist b/build-info.plist index e107bed..aab1f0c 100644 --- a/build-info.plist +++ b/build-info.plist @@ -17,6 +17,6 @@ suppress_bundle_relocation version - 2.3.1 + 2.3.2