#!/bin/sh if [ -z "`ps -eaf | grep mattermost | grep java`" ]; then echo "Mattermost was not started." else ps -eaf | grep mattermost | grep java | awk '{print $2}' | while read PID do echo "Killing $PID ..." kill -9 $PID echo echo "Mattermost is being shutdowned." done fi |