shell
print_help() { cat << EOFuse regist_co.sh args1 args2 args1 - The Hostname of the machine to be registered to the consul cluster , For example: co-mini-jupiter-x args2 - What's the type of IP , For example: 10.50.0.196 args4 - Consul server ip address As follows: 兰亭美国: 10.50.0.2409 兰亭欧洲: 10.241.2.100 Run as: ./regist_co.sh co-mini-jupiter-x 10.50.0.19xEOF}if [ "$#" != 2 ]; then print_help; exit 1; fi
python
if len(sys.argv) < 3: print ('''Usage : python '''+sys.argv[0]+''' <hostname> <ip> {<node>|None}''')else: hostname = sys.argv[1] ip = sys.argv[2] if ip.split(".")[0] == '10' and ip.split(".")[1] == '50':