Upload files to "/"
This commit is contained in:
commit
e5a81167fe
1 changed files with 28 additions and 0 deletions
28
reckill.zsh
Normal file
28
reckill.zsh
Normal file
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue