#!/bin/bash

file=$1
allow_url_param=""

if [ -f "$file" ]
then
  echo "$file found."

  while read -r url
  do
    if [[ ! -z $url ]]
    then
      allow_url_param+="--http-allow-url ${url} "
    fi
  done < "$file"

else
  echo "$file not found"
fi

echo "==============="
echo $allow_url_param
echo "==============="

echo "从$2上复制流量(来自文件$1配置的URL)到$3上"
sudo ./gor --input-raw $2 --output-http $3 $allow_url_param

