Added --accept-license and --accept-gdpr to command speedtest

This commit is contained in:
Luiz F Picolo 2023-09-11 22:47:47 -04:00
parent 085dd1c509
commit f7cc2b29e3

View File

@ -39,7 +39,7 @@ class Rate < ActiveRecord::Base
end end
def self.run_speedtest def self.run_speedtest
output = `speedtest` output = `speedtest --accept-license --accept-gdpr`
if $?.success? if $?.success?
download_speed = output.match(/Download:\s+(\d+\.\d+)\sMbps/)[1] download_speed = output.match(/Download:\s+(\d+\.\d+)\sMbps/)[1]
upload_speed = output.match(/Upload:\s+(\d+\.\d+)\sMbps/)[1] upload_speed = output.match(/Upload:\s+(\d+\.\d+)\sMbps/)[1]