#!/bin/bash

install_path=$1
function remote_install_base() {
    IP_LIST_CLONE=(IP ${IP_LIST[@]})
    #string_check ${IP_LIST_CLONE[@]}
    for ip in ${IP_LIST[@]}; do
        echo "============"$ip
        echo $SSH_PORT
        echo ${SSH_OPT}
        USER=$(get_node_attribute "$REGION" $ip user)
        PASSWORD=$(get_node_attribute "$REGION" $ip password)
        echo ${USER}
        echo ${PASSWORD}
        sshpass ssh -p $SSH_PORT ${SSH_OPT} ${USER}@${ip} 'source /tmp/scripts/remote_env.sh && cat /tmp/scripts/remote_env.sh && source /tmp/scripts/docker_install.sh'
        sleep 1
    done
}

remote_install_base
