#!/bin/bash
for i in `pgrep mysql`;do
kill -0 $i
if [ $? != "0" ];then
echo "mysql $i process no exit"
else
echo "mysql $i process exit"
fi
done
if [ -z $1 ];then
echo "Need put in program name"
exit 1
else
for i in `pgrep $1`;do
kill -0 $i
if [ $? != "0" ];then
echo "$1 $i process no exit"
else
echo "$1 $i process exit"
fi
done
fi
if [ -d /proc/$1 ];then
echo " process $1 exit"
exit 0
else
echo " process $1 no exit"
exit 1
fi
for i in `pgrep mysql`;do
kill -0 $i
if [ $? != "0" ];then
echo "mysql $i process no exit"
else
echo "mysql $i process exit"
fi
done
if [ -z $1 ];then
echo "Need put in program name"
exit 1
else
for i in `pgrep $1`;do
kill -0 $i
if [ $? != "0" ];then
echo "$1 $i process no exit"
else
echo "$1 $i process exit"
fi
done
fi
if [ -d /proc/$1 ];then
echo " process $1 exit"
exit 0
else
echo " process $1 no exit"
exit 1
fi