#!/bin/sh

# # # # # # # # # # # # # # # # # # # # # #
# @author : wangjf
# @date : 2020-09-10 16:38:51
# # # # # # # # # # # # # # # # # # # # # #

check_await(){
    while [[ true ]];
    do
        check=`ssh -o "StrictHostKeyChecking no" -i /home/hadoop/wangjf/dataplatform_cn.pem -l root 182.92.177.185 "/root/workspace/check_iqiyi.sh"`
        if [[ $check = 'True' ]]
        then
            echo "OK"
            break
        fi
        sleep 300
    done
}

check_await

if [[ $? -ne 0 ]];then
  exit 255
fi