From e5a81167fec26a1898e43cc8ed0d5a6fb2e739e5 Mon Sep 17 00:00:00 2001 From: sneedgroup-holder Date: Mon, 9 Dec 2024 19:36:41 +0000 Subject: [PATCH] Upload files to "/" --- reckill.zsh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 reckill.zsh 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 +