TDengine/tests/script/sh/dockerbuilder/addFqdnToHost.sh
Shuduo Sang 43feda0595
[TD-13408]<test>: move tests in for3.0 (#10598)
* restore .gitmodules

* Revert "[TD-13408]<test>: move tests out"

This reverts commit f80a4ca49f.

* revert f80a4ca49f

* immigrate file change from stand-alone repo to TDengine

for 3.0

* remove tests repository for Jenkinsfile2

Co-authored-by: tangfangzhi <fztang@taosdata.com>
2022-03-07 19:25:29 +08:00

46 lines
673 B
Bash
Executable file

#!/bin/bash
#
# deploy test cluster
set -e
#set -x
dnodeNumber=1
subnet="172.33.0.0/16"
while getopts "hn:s:" arg
do
case $arg in
n)
dnodeNumber=$(echo $OPTARG)
;;
s)
subnet=$(echo $OPTARG)
;;
h)
echo "Usage: `basename $0` -n [ dnode number] "
echo " -s [ subnet] "
exit 0
;;
?) #unknow option
echo "unkonw argument"
exit 1
;;
esac
done
addFqdnToHosts() {
index=$1
ipPrefix=$2
let ipIndex=index+1
echo "${ipPrefix}.${ipIndex} node${i}" >> /etc/hosts
}
ipPrefix=${subnet%.*}
for ((i=1; i<=${dnodeNumber}; i++)); do
addFqdnToHosts ${i} ${ipPrefix}
done