#!/bin/bash
# 节点特定的集群配置

# usage:
#       HOST=HOSTNAME ADDR=192.168.123.123 IPMIIP=192.168.111.111 IPMIUSER=ADMIN IPMIPASS=password PASSWORD=password ./join

if [ -z "$SSH" ];then
    source /unas/sbin/dualcontroller/config/prepare
fi

if [ -z "$PCS" ];then
    PCS=pcs
fi

# IPMI配置
if ! /unas/sbin/dualcontroller/config/stonith;then
    exit 1
fi

# 绑定UNAS_Node_IP
for (( i=0; i<$array_length; i+=1 ))
do
    if ! $PCS constraint location show resource UNAS_Node_IP$i --full | grep Enabled;then
        $PCS constraint location UNAS_Node_IP$i prefers $HOST=100
    fi

done
