Doug Dalton's technology and other stuff....
__________
|[][][] []\__
|Shortblog |
|_/-\_____/-\_/
0 0
Whats Here:
Home
|
Coding
|
Mobile
|
Random
|
System / Network Projects
|
About The Bus
|
Contact
--
RSS Feed
(
?
) --
Get back on the bus
Thursday, November 30, 2006
Simple Script to check if a process is running and if not restart it
I wrote this simple script to check if a process is running and if not restart it
#!/bin/sh
TEST=`pgrep $1`
if [ ! "$TEST" ]
then
$2
else
echo "$1 Alive "
fi
Usage:
check.sh
Example:
check.sh named /usr/local/sbin/named
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment