echo "### Service will start..."
cd /opt/app/rdrs_app/rdrs
nohup /opt/openjdk-1.8.0_92/bin/java -jar rdrs_service-0.0.1.jar >/dev/null 2>&1 &
ip=$(ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' |
cut -d: -f2 | awk '{ print $1}')
for i in $(seq 1 12)
do
res=$(curl $ip':8082/rdrs/service/mgr/topo/pin' --silent )
if [ "$res" = "running" ]; then
echo "Service Success!"
exit 0
fi
echo "$i waiting next curl..."
sleep 5
done
echo "Service failed"
exit 1