#!/bin/bash
cwd=`pwd`
pid=$1
host=$2

#检查本地的进程
if [ $host == "127.0.0.1" ];then
    exist=`ps aux | awk '{print $2}' | grep -w $pid`
    if [ ! $exist ];then
        exit 0
    else
        exit 1
    fi
#检查远程的进程
else
    cmd="cd "
    exist=`ssh $host "cd $cwd;bash $cwd/bin/checkpid_exist_remote.sh $pid"`
    if [ ! $exist ];then
        exit 0
    else 
        exit 1
    fi
fi



