Skip to content

Instantly share code, notes, and snippets.

@sarkrui
Created January 5, 2024 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sarkrui/1e8f7043d16e17643f9c92614b8508ce to your computer and use it in GitHub Desktop.
Save sarkrui/1e8f7043d16e17643f9c92614b8508ce to your computer and use it in GitHub Desktop.
Constantly killing ptpcamerad on Sonoma
while true; do
    # Get the PID of the prpcamerad service
    pid=$(pgrep -x "ptpcamerad")

    if [ -n "$pid" ]; then
        echo "Service prpcamerad is running with PID: $pid. Attempting to stop it..."
        # Kill the service using its PID
        sudo kill -9 $pid
    else
        echo "Service ptpcamerad is not running currently."
    fi
    # Wait for a short period before checking again
    sleep 0.05
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment