DataStage start and stop shell

 bash shell to start and stop Information Server DataStage

#!/usr/bin/bash
#
# Name isds.sh
# Parameter stop/start
DB2INSTUSER=db2inst1
if [[ -n $1 && $1 = 'stop' ]]; then
echo "stopping Information Server!"
if [[ $(ps -ef | grep dsrpcd | grep -v grep | wc -l) -eq 0 ]]; then
echo "already stopped."
exit 1
fi
su - dsadm -c ". /opt/IBM/InformationServer/Server/DSEngine/dsenv; /opt/IBM/InformationServer/Server/DSEngine/bin/uv -admin -stop"
cd /opt/IBM/InformationServer/ASBNode/bin
./NodeAgents.sh stop
cd  /opt/IBM/InformationServer/ASBServer/bin
./MetadataServer.sh stop
cd /opt/IBM/InformationServer/shared-open-source/bin
./stop-linux-services.sh
echo "db2stopping!"
su - $DB2INSTUSER -c "db2stop"
elif [[ -n $1 && $1 = 'start' ]]; then
echo "starting Information Server!"
if [[ $(ps -ef | grep dsrpcd | grep -v grep | wc -l) -eq 1 ]]; then
echo "already started."
exit 1
fi
echo "db2starting!"
su - $DB2INSTUSER -c "db2start"
cd /opt/IBM/InformationServer/shared-open-source/bin
./start-linux-services.sh
cd  /opt/IBM/InformationServer/ASBServer/bin
./MetadataServer.sh run
cd /opt/IBM/InformationServer/ASBNode/bin
./NodeAgents.sh start
su - dsadm -c ". /opt/IBM/InformationServer/Server/DSEngine/dsenv; /opt/IBM/InformationServer/Server/DSEngine/bin/uv -admin -start"
else
echo -e "Information Server start and stop shell\nPlease type \"isds.sh start/stop\""
fi
exit 0

コメント

人気の投稿