#!/bin/sh #if [ $# -ne 1 ]; then # echo "-----------------------------------" # echo " Undefined parameter" # echo "./stopFo.sh [application name]" # echo "-----------------------------------" # exit 1 #fi PIDS=`ps -ef | grep java | grep adds-fo | awk '{print $2}'` for PID in $PIDS; do echo "Process ID: $PID" done if [ -z "$PIDS" ]; then echo "==============================" echo " No adds-fo deamon is running" echo "==============================" else for PID in $PIDS; do echo "===============================" echo "Kill adds-fo[$PID] process" sudo kill -9 $PID echo "adds-fo[$PID] application stop" echo "===============================" done fi