diff --git a/Dockerfile b/Dockerfile index 2ad49a4..81e517b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,8 @@ ENV WG_CONF_DIR=$WG_CONF_DIR WG_CLIENTS_DIR=$WG_CLIENTS_DIR WG_KEYS_DIR=$WG_KEYS ENV WG_ENDPOINT_HOST=$WG_ENDPOINT_HOST WG_ENDPOINT_PORT=$WG_ENDPOINT_PORT WG_IPv4_SUBNET=$WG_IPv4_SUBNET WG_IPv6_SUBNET=$WG_IPv6_SUBNET ENV WG_DNS=$WG_DNS WG_ALLOWED_IP_1=$WG_ALLOWED_IP_1 WG_ALLOWED_IP_2=$WG_ALLOWED_IP_2 ENV WG_PRE_UP=$WG_PRE_UP WG_POST_UP=$WG_POST_UP WG_PRE_DOWN=$WG_PRE_DOWN WG_POST_DOWN=$WG_POST_DOWN +RUN wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py +RUN chmod +x speedtest-cli RUN echo $'#!/usr/bin/env bash\n\ set -eo pipefail\n\ /app/erebrus &\n\ diff --git a/util/pkg/speedtest/speedtest.go b/util/pkg/speedtest/speedtest.go index 34c0f71..5ae372e 100644 --- a/util/pkg/speedtest/speedtest.go +++ b/util/pkg/speedtest/speedtest.go @@ -12,11 +12,11 @@ type SpeedtestResult struct { } func GetSpeedtestResults() (res *SpeedtestResult, err error) { - cmd := exec.Command("speedtest", "--json") + cmd := exec.Command("speedtest-cli", "--json") output, err := cmd.CombinedOutput() if err != nil { - return nil, fmt.Errorf("failed to execute 'speedtest --json': %v", err) + return nil, fmt.Errorf("failed to execute 'speedtest-cli --json': %v", err) } // Parse the Speedtest results