We've been using @mm2270's script for quite some time, it works great.
But for some reason won't quit VLC 2.2.5.1 (quits older versions without a problem).
Here is the script, the process name is VLC
as per Activity Monitor:
#!/bin/bash
# Kudos to @2270 on Jamf Nation.
# EXACT process name (if multiple, carriage return between each)
PROCESSES=("VLC")
# Exact application path.
APPLICATION=""
# Do not edit between these two lines ---------------------------------------------------
for PROC in "${PROCESSES[@]}"; do
RUNNING_PROCESSES=$(ps axc | grep -i "$PROC" | awk '{print $1}')
if [[ $RUNNING_PROCESSES ]]; then
echo "Found running process $PROC with PID: ${RUNNING_PROCESSES}. Killing it..."
kill $RUNNING_PROCESSES
else
echo "$PROC not found running..."
fi
done
# Do not edit between these two lines ---------------------------------------------------
# Remove application
# /bin/rm -rf "$APPLICATION" 2> /dev/null
exit 0
Any ideas?