commit e5a81167fec26a1898e43cc8ed0d5a6fb2e739e5 Author: sneedgroup-holder Date: Mon Dec 9 19:36:41 2024 +0000 Upload files to "/" diff --git a/reckill.zsh b/reckill.zsh new file mode 100644 index 0000000..b688737 --- /dev/null +++ b/reckill.zsh @@ -0,0 +1,28 @@ +#!/bin/zsh + +# Check for processes using the audio or video resources +echo "Checking for processes that might be recording..." + +# Find processes using the audio or video resources (CoreAudio and video) +audio_processes=$(lsof | grep -E 'CoreAudio|video') + +if [[ -n "$audio_processes" ]]; then + echo "Possible recording app found using audio or video resources:" + echo "$audio_processes" + + # Extract only the PIDs (column 2), handling spaces correctly + pids=$(echo "$audio_processes" | awk '{print $2}' | sort | uniq) + echo $pids + # Loop through each PID and kill it + pidArray=(${(f)pids}) + echo $pidArray + for pid in "${pidArray[@]}"; do + if [[ "$pid" =~ ^[0-9]+$ ]]; then # Make sure it's a valid PID (numeric) + echo "Killing process with PID: $pid" + kill -9 "$pid" # Ensure each PID is passed separately + fi + done +else + echo "No processes found using audio or video resources." +fi +