#!/bin/bash app=${name}-${version}.jar pid=`ps -ef|grep \$app|grep -v "grep"|awk '{print \$2}'` if [ -z \$pid ] then echo 'service not start!' else kill \$pid echo \$pid echo 'service is killed!' fi