Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSUpdateNotifier: checkAttemptToQuit() function will not quit if input value is empty #37

Open
phu-ngo opened this issue Jan 10, 2022 · 0 comments

Comments

@phu-ngo
Copy link

phu-ngo commented Jan 10, 2022

in some case the jamfhelper killed by terminal or Activity Monitor it will not return 239 error code and return empty intend

old code

checkAttemptToQuit(){
    Value="${1}"
    
    # Jamf Helper was exited without making a choice
    if [[ "$Value" == "239" ]]; then
        echo "Jamf Helper was exited without making a choice."
        "$jamf" policy -event "$CustomTriggerNameDeprecationPolicy" &
        exit 0
    fi
}

fix

checkAttemptToQuit(){
    Value="${1}"
    
    # Jamf Helper was exited without making a choice
    # pngo 12/31/21: include empty return code
    # The 239 return value is defaults when user quit the jamfhelper (Command+Q) if user kill it using kill [pid] command it will return empty
    if [[ "$Value" == "239" ]] || [[ -z "$Value" ]]; then
        echo "Jamf Helper was exited without making a choice."
        "$jamf" policy -event "$CustomTriggerNameDeprecationPolicy" &
        exit 0
    fi
}
@phu-ngo phu-ngo changed the title checkAttemptToQuit() function will not quit if input value is empty OSUpdateNotifier: checkAttemptToQuit() function will not quit if input value is empty Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant