ago
24
bounce_like_a_tiger.sh
Since the rest of the team found the name of the script I created to bounce our OBIEE server very comic I decided to share bounce_like_a_tiger.sh with you:
#!/bin/sh
#Initialization
#get the action/parameter
command=$1
bin_ps=/bin/ps
bin_awk=/usr/bin/awk
bin_grep=/usr/bin/grep
#validate that the action to execute is either start, stop, forcestop or autorestart
if [ "$command" = "start" -o "$command" = "stop" -o "$command" = "forcestop" -o "$command" = "autorestart" ]; then
#set work directory
OBI_HOME=/opt/OBIEE/OracleBI
export OBI_HOME
else
echo “Invalid parameter…”
echo “Syntax: ”
echo ” obiee.sh { start | stop | forcestop | autorestart }”
exit 1
fi
if [ "$command" = "start" ]; then
echo “obiee.sh WILL START ALL SERVICES…”
echo “”
#Step 1: execute command on OBI Server
processname=run-sa.sh
echo “Executing: ”
echo ${OBI_HOME}/setup/run-sa.sh $command
${OBI_HOME}/setup/run-sa.sh $command
ec=$?
echo “exit code: ” $ec
echo “…”
echo “…”
if [ "$ec" != "0" ]; then
echo “An error occurred running run-sa.sh … OBIEE.sh is aborting…”
exit 1
fi
#Step 2: execute command on OBI Presentation Services
echo “Executing: ”
echo ${OBI_HOME}/setup/run-saw.sh $command
${OBI_HOME}/setup/run-saw.sh $command
ec=$?
echo “exit code: ” $ec
echo “…”
echo “…”
if [ "$ec" != "0" ]; then
echo “An error occurred running run-saw.sh … OBIEE.sh is aborting…”
exit 1
fi
#Step 3: execute command on OBI Scheduler
echo “Executing: ”
echo ${OBI_HOME}/setup/run-sch.sh $command
${OBI_HOME}/setup/run-sch.sh $command
ec=$?
echo “exit code: ” $ec
echo “…”
echo “…”
if [ "$ec" != "0" ]; then
echo “An error occurred running run-sch.sh … OBIEE.sh is aborting…”
exit 1
fi
#Step 4: execute command on OBI Cluster Controller
echo “Executing: ”
echo ${OBI_HOME}/setup/run-ccs.sh $command
${OBI_HOME}/setup/run-ccs.sh $command
ec=$?
echo “exit code: ” $ec
if [ "$ec" != "0" ]; then
echo “An error occurred running run-ccs.sh … OBIEE.sh is aborting…”
exit 1
fi
elif [ "$command" = "stop" -o "$command" = "forcestop" ]; then
echo “obiee.sh WILL SHUTDOWN ALL SERVICES…”
echo “”
#Step 4: execute command on OBI Cluster Controller
echo “Executing: ”
echo ${OBI_HOME}/setup/run-ccs.sh $command
${OBI_HOME}/setup/run-ccs.sh $command
ec=$?
echo “exit code: ” $ec
echo “…”
echo “…”
if [ "$ec" != "0" ]; then
echo “An error occurred running run-ccs.sh … OBIEE.sh is aborting…”
exit 1
fi
#Step 3: execute command on OBI Scheduler
echo “Executing: ”
echo ${OBI_HOME}/setup/run-sch.sh $command
${OBI_HOME}/setup/run-sch.sh $command
ec=$?
echo “exit code: ” $ec
echo “…”
echo “…”
if [ "$ec" != "0" ]; then
echo “An error occurred running run-sch.sh … OBIEE.sh is aborting…”
exit 1
fi
#Step 2: execute command on OBI Presentation Services
echo “Executing: ”
echo ${OBI_HOME}/setup/run-saw.sh $command
${OBI_HOME}/setup/run-saw.sh $command
ec=$?
echo “exit code: ” $ec
echo “…”
echo “…”
if [ "$ec" != "0" ]; then
echo “An error occurred running run-saw.sh … OBIEE.sh is aborting…”
exit 1
fi
#Step 1: execute command on OBI Server
echo “Executing: ”
echo ${OBI_HOME}/setup/run-sa.sh $command
${OBI_HOME}/setup/run-sa.sh $command
ec=$?
echo “exit code: ” $ec
if [ "$ec" != "0" ]; then
echo “An error occurred running run-sa.sh … OBIEE.sh is aborting…”
exit 1
fi
fi
exit 0