mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-21 21:33:08 +01:00
Added home prefixes to helpers
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -15,3 +15,4 @@ yarn-error.log
|
|||||||
|
|
||||||
_ide_helper.php
|
_ide_helper.php
|
||||||
.idea
|
.idea
|
||||||
|
.config
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Speedtest Tracker
|
# Speedtest Tracker
|
||||||
|
|
||||||
[](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) [](https://github.com/henrywhitaker3/Speedtest-Tracker/commits)  [](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE)
|
[](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) [](https://github.com/henrywhitaker3/Speedtest-Tracker/commits)  [](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE)
|
||||||
|
|
||||||
This program runs a speedtest check every hour and graphs the results. The back-end is written in [Laravel](https://laravel.com/) and the front-end uses [React](https://reactjs.org/). It uses the [Ookla's speedtest cli](https://www.speedtest.net/apps/cli) package to get the data and uses [Chart.js](https://www.chartjs.org/) to plot the results.
|
This program runs a speedtest check every hour and graphs the results. The back-end is written in [Laravel](https://laravel.com/) and the front-end uses [React](https://reactjs.org/). It uses the [Ookla's speedtest cli](https://www.speedtest.net/apps/cli) package to get the data and uses [Chart.js](https://www.chartjs.org/) to plot the results.
|
||||||
|
|
||||||
|
|||||||
43
app/Console/Commands/AcceptEULACommand.php
Normal file
43
app/Console/Commands/AcceptEULACommand.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use PhpParser\Node\Expr\ShellExec;
|
||||||
|
|
||||||
|
class AcceptEULACommand extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'speedtest:eula';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Accept the Ookla EULA and GDPR agreements.';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
shell_exec('HOME=' . base_path() . '/ && ' . app_path() . '/Bin/speedtest --accept-license --accept-gdpr');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -78,7 +78,10 @@ class SpeedtestHelper {
|
|||||||
public static function output()
|
public static function output()
|
||||||
{
|
{
|
||||||
$server = SettingsHelper::get('server')['value'];
|
$server = SettingsHelper::get('server')['value'];
|
||||||
|
|
||||||
$binPath = app_path() . DIRECTORY_SEPARATOR . 'Bin' . DIRECTORY_SEPARATOR . 'speedtest';
|
$binPath = app_path() . DIRECTORY_SEPARATOR . 'Bin' . DIRECTORY_SEPARATOR . 'speedtest';
|
||||||
|
$homePrefix = 'HOME=' . base_path() . '/ && ';
|
||||||
|
|
||||||
if($server != '' && $server != false) {
|
if($server != '' && $server != false) {
|
||||||
$server = explode(',', $server);
|
$server = explode(',', $server);
|
||||||
$server = $server[array_rand($server)];
|
$server = $server[array_rand($server)];
|
||||||
@@ -87,10 +90,10 @@ class SpeedtestHelper {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return shell_exec($binPath . ' -f json -s ' . $server);
|
return shell_exec($homePrefix . $binPath . ' -f json -s ' . $server);
|
||||||
}
|
}
|
||||||
|
|
||||||
return shell_exec($binPath . ' -f json');
|
return shell_exec($homePrefix . $binPath . ' -f json');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
{
|
{
|
||||||
|
"1.7.15": [
|
||||||
|
{
|
||||||
|
"description": "Updates for manual installs.",
|
||||||
|
"link": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
"1.7.14": [
|
"1.7.14": [
|
||||||
{
|
{
|
||||||
"description": "Updated dependencies.",
|
"description": "Updated dependencies.",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ return [
|
|||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'version' => '1.7.14',
|
'version' => '1.7.15',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user