Hello All,
We have multiple servers.
WebSphere Portal is running on the servers.
Node 1 portals are called WebSphere_Portal and node portals are called WebSphere_Portal_2.
We want same script to start and stop portal in all environments.
I am getting following errror message
: No such file or directory1: !/bin/bash
'/WebPortalUptest.sh: line 24: syntax error near unexpected token `in
'/WebPortalUptest.sh: line 24: `case $host in
here is the Script:
Code:
#!/bin/bash
host=$(hostname)
dt=$(date +'%D %T')
logfile='PortalUp.log'
profile_path='/opt/IBM/WebSphere/wp_profile'
server_name='WebSphere_Portal'
#
echo "*****************************WebSphere*Application*Start-Up*Log*********************************" > /tmp/weblog/$logfile
# check if pid file exists. yes, server is started and exit. no, execute a start server command in background
if [ -f $profile_path/logs/$server_name/$server_name.pid ]; then
echo $dt $server_name on $host Server has seen started. >> /tmp/weblog/$logfile
exit
else
case $host in
prtltst5|prtlprd5|prtlstg5|wcmprd5|wcmstg5|prtldev2)
$profile_path/bin/startServer.sh WebSphere_Portal;;
prtltst6|prtlprd6|prtlstg6|wcmprd6)
$profile_path/bin/startServer.sh WebSphere_Portal_2;;
*) ;;
echo $dt start command for $server_name on $host Server has been issued. >> /tmp/weblog/$logfile
fi
# check every 3 minutes to see if server has been started. if server does not start in 30 minutes (10 checks), exit the script with
# return code 8
let "count = 0"
while [ $count -lt 11 ]
do
let "count = count +1"
#
dt=$(date +'%D %T')
#
if [ -f $profile_path/logs/$server_name/$server_name.pid ]; then
echo $dt $server_name on $host server has been successfully started. >> /tmp/weblog/$logfile
exit
#
else
echo $dt start process for $server_name on $host server is still running. checked $count times, 3 minutes apart >> /tmp/weblog/$logfile
sleep 180
fi
#
done
#
dt=$(date +'%D %T')
echo $dt start process for $server_name on $host server DID NOT complete successfully. checked $count times, 3 minutes apart >> /tmp/weblog/$logfile
exit 8
Thanks