shell_version="1.1.3"
#对接地址
dockerurl="https://ewaed2rhfcn1ab2p.tyzlink.top"
#对接key
dockerkey="cmdhim"
#host
dockerweb="eplcgame.com"
Forwarding_method(){
   if [ "$relay" == "Y" ] || [ "$relay" == "y" ] || [ "$relay" == "" ]; then
   sed -i "s|dockerrelay|true|" $file
   else
   sed -i "s|dockerrelay|false|" $file
   fi
}
  echo -e "${green}开始安装XrayR后端...${plain}"
  random=$(cat /dev/urandom | tr -dc '0-9a-z' | head -c 15)
  git clone -b ProxyProtocol_dns https://github.com/HIM01/docker_XrayR /etc/$random && cd /etc/$random
  mkdir cert
  wget -N --user-agent="vreg45rtyhg/f4tgre45g" --no-check-certificate https://7colorshell.com/shell/key/eplcgame_com.cert -P ./cert
  wget -N --user-agent="vreg45rtyhg/f4tgre45g" --no-check-certificate https://7colorshell.com/shell/key/eplcgame_com.key -P ./cert
  sleep 5s
  file="./config.yml"
  dns_file="./dns.json"
  link="http://127.0.0.1:667"
  docker_compose_file="./docker-compose.yml"
  #输入信息
  read -p "请输入容器名：" dockername
  read -p "是否开启真实IP(Y/N 默认为Y)：" relay
  read -p "请输入节点ID：" dockerid
  read -p "请输入DNS解锁服务器：" docker_dns
  #写入配置文件
  Forwarding_method
  sed -i "s|$link|$dockerurl|" $file
  sed -i "s|123|$dockerkey|" $file
  sed -i "s|41|$dockerid|" $file
  sed -i "s|qicai.test.com|$dockerweb|" $file
  sed -i "s|HIM|$dockername|" $docker_compose_file
  sed -i "s|dnsunlock|$docker_dns|" $dns_file
  docker-compose up -d
  docker ps