Authored by Rong

add by shell

@@ -13,6 +13,16 @@ if [[ ! $3 ]];then @@ -13,6 +13,16 @@ if [[ ! $3 ]];then
13 exit 1 13 exit 1
14 fi 14 fi
15 15
  16 +HOST=""
  17 +if [[ $4 ]];then
  18 + HOST=$4
  19 +fi
  20 +HOST_NAME=$(hostname)
  21 +IP=$(/sbin/ip addr show | grep -e eth -e p4p | grep inet | awk '{print $2}' | awk -F '/' '{print $1}')
  22 +HOST=$(echo $HOST | sed 's/,/\\n/g')
  23 +HOST="127.0.0.1 localhost\n::1 localhost\n${IP} ${HOST_NAME}\n${HOST}"
  24 +echo -e $HOST > /etc/hosts
  25 +
16 basepath=$(cd `dirname $0`; pwd) 26 basepath=$(cd `dirname $0`; pwd)
17 LOG_PATH=/Data/logs/jmeter/gor.log 27 LOG_PATH=/Data/logs/jmeter/gor.log
18 28