Upload files to "/"

This commit is contained in:
The Ghost of FOSS' Past 2024-12-09 19:36:41 +00:00
commit e5a81167fe

28
reckill.zsh Normal file
View 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