Update test.sh

This commit is contained in:
2019-02-07 11:43:23 -06:00
parent 361b702324
commit 47a2ed2110

27
test.sh
View File

@@ -2,6 +2,7 @@
source /opt/idssys/defaults/colors.inc
source /opt/idssys/defaults/default.inc
source /opt/idssys/nodemgmt/defaults.inc
source /opt/idssys/settings/nodemgmt.conf
cd /opt/idssys/defaults
@@ -18,13 +19,21 @@ if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remot
exit 0
fi
IP=$(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1)
IP=${IP//$'\n'/}; IP=$(echo $IP | sed "s/10.5.10.56//g")
echo "'${IP}'"
echo "'${NODEHOSTS}'"
if [[ $IP == *"${NODEHOSTS}"* ]]; then
echo 'is a node'
else
echo 'not a node'
fi
if [ ! -z ${LOCAL_SERVICES+x} ];
then NCMD='ssh root@10.5.10.51'
else NCMD=''
fi
echo "HERE: ${NCMD}"
for rcheck in "${REPL_CHECK[@]}"; do
${NCMD} rm -f ${FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S`
if [ "${NCMD}" = "" ]; then
echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl
else
${NCMD} 'echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl'
fi
yes | ${NCMD} cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
echo "${FOLDER}/test.repl"
${NCMD} cat ${FOLDER}/test.repl
done