Originally posted by: SystemAdmin
Guys,
I am trying to create a script to automatically restart an application server process if it goes down. The problem that I am having that the script attempts a restart even if the process is running. I think the issue is on this line: if
$? -eq 0 but I cannot figure it out.
See script details below (I am also attaching the script):
#!/bin/bash
-
Restart UAT External Services if stopped
#<hr />
-
This script was created by .....
#<hr />
#
RESTART="/apps/WebSphere/AppServer/profiles/fcatfcib2/bin/startServer.sh Member2
"
-
find Member2 pid
ps -ef | grep Member2
if
$? -eq 0 then
# restart UAT External
$RESTART
fi
echo $output
#AIX-Forum