#!/bin/bash

cd /srv/app/gfw/

yq "" pac/config/custom.yaml > gfwlist-to-dnsmasq-rule/custom_proxy_hosts.json

rsync --verbose gfwlist-to-dnsmasq-rule/{main.py,custom_proxy_hosts.json} root@192.168.10.1:/root/gfwlist-to-dnsmasq-rule
ssh root@192.168.10.1 "/usr/bin/python /root/gfwlist-to-dnsmasq-rule/main.py"