Compare commits
3 Commits
v20220306.
...
v20220306.
Author | SHA1 | Date | |
---|---|---|---|
310f59e03c | |||
a6992b2373 | |||
31859569fc |
@ -14,6 +14,7 @@ builds:
|
|||||||
- linux
|
- linux
|
||||||
- windows
|
- windows
|
||||||
- darwin
|
- darwin
|
||||||
|
mod_timestamp: "{{ .CommitTimestamp }}"
|
||||||
archives:
|
archives:
|
||||||
- replacements:
|
- replacements:
|
||||||
darwin: Darwin
|
darwin: Darwin
|
||||||
@ -21,6 +22,8 @@ archives:
|
|||||||
windows: Windows
|
windows: Windows
|
||||||
386: i386
|
386: i386
|
||||||
amd64: x86_64
|
amd64: x86_64
|
||||||
|
format: binary
|
||||||
|
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
name_template: 'checksums.txt'
|
||||||
snapshot:
|
snapshot:
|
||||||
|
14
README.md
14
README.md
@ -1,7 +1,7 @@
|
|||||||
# mullvad-best-server
|
# mullvad-best-server
|
||||||

|

|
||||||
|
|
||||||
Determines the mullvat.net wireguard server with the lowest latency.
|
Determines the mullvad.net server with the lowest latency.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@ -30,3 +30,15 @@ The `-c` flag allows to give a country code. Else `ch` will be used.
|
|||||||
## Background
|
## Background
|
||||||
The program uses `https://api.mullvad.net/www/relays/<SERVER_TYPE/` to get the current server list, pings the ones with the right country
|
The program uses `https://api.mullvad.net/www/relays/<SERVER_TYPE/` to get the current server list, pings the ones with the right country
|
||||||
and outputs the server with the lowest ping.
|
and outputs the server with the lowest ping.
|
||||||
|
|
||||||
|
## Integration into a script
|
||||||
|
I use it on my router like this (yes, I know I could have done the whole thing with jq and shell scripting, but wanted to use go for maintainability).
|
||||||
|
```
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
LATEST_RELEASE=$(curl -sSL https://api.github.com/repos/bastiandoetsch/mullvad-best-server/releases/latest | jq -r '.assets[]| .browser_download_url' | grep Linux_arm64)
|
||||||
|
curl -sSL $LATEST_RELEASE > /root/mullvad-best-server
|
||||||
|
chmod +x /root/mullvad-best-server
|
||||||
|
/usr/bin/wg-quick down $(wg show|grep interface | cut -d: -f2) || echo "nothing to shut down"
|
||||||
|
/usr/bin/wg-quick up "mullvad-$(/root/mullvad-best-server -c de)"
|
||||||
|
```
|
||||||
|
Reference in New Issue
Block a user