[Other] Update scripts

This commit is contained in:
Connection Refused
2021-10-16 13:07:33 +08:00
parent d84476025b
commit 63355965f3
5 changed files with 10 additions and 27 deletions

23
Other/chnsite/build.ps1 Normal file
View File

@@ -0,0 +1,23 @@
Set-Location (Split-Path $MyInvocation.MyCommand.Path -Parent)
try {
Invoke-WebRequest `
-Uri 'https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf' `
-OutFile 'chnsite.txt'
}
catch {
exit 1
}
foreach ( $data in (Get-Content -Path 'chnsite.txt') ) {
$data = $data.Replace('server=/', '')
$data = $data.Replace('/114.114.114.114', '')
$data = $data.Trim()
if ( $data.Length -gt 0 ) {
Add-Content -Path 'newsite.txt' -Value $data
}
}
mv -Force 'newsite.txt' '..\release\chnsite.txt'
exit 0