#!/bin/bash
source $HOME/.bashrc

PROCESS_NAME="$1"
if [ ${#PROCESS_NAME} -ge $PROCESS_NAME_LENGTH ]; then
        PID_OF_PROCESS="$(ps -ef | grep "$PROCESS_NAME" | egrep -v 'grep|SKServer' | awk -F" " '{print $2}' 2>/dev/null|tr -d ' '|head -1)"
else
        PID_OF_PROCESS="$(ps -o pid -C "$PROCESS_NAME" h|sed 's/ //g'|head -1)"
fi

#sudo kill -15 $PID_OF_PROCESS
sudo ps -ef | grep ${PROCESS_NAME} | grep -v grep | awk '{print $2}' | xargs kill
