Update web.php
This commit is contained in:
parent
19ef66abd4
commit
881537c9c6
1 changed files with 15 additions and 7 deletions
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use phpseclib3\Net\SSH2;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -25,13 +26,20 @@ Route::get('/', function () {
|
||||||
|
|
||||||
Route::get('dev', function () {
|
Route::get('dev', function () {
|
||||||
|
|
||||||
$create = new \App\Models\PhyreServer();
|
$phyreServer = \App\Models\PhyreServer::find(15);
|
||||||
$create->name = 'hetzner1';
|
|
||||||
$create->ip = '37.27.28.220';
|
$ssh = new SSH2($phyreServer->ip);
|
||||||
$create->port = '22';
|
if ($ssh->login($phyreServer->username, $phyreServer->password)) {
|
||||||
$create->username = 'root';
|
dd($ssh->exec('cat phyre-install.log'));
|
||||||
$create->password = 'WTuiMuxqpdMLWv3b3Nxv';
|
}
|
||||||
$create->save();
|
|
||||||
|
// $create = new \App\Models\PhyreServer();
|
||||||
|
// $create->name = 'hetzner1';
|
||||||
|
// $create->ip = 'random-ip';
|
||||||
|
// $create->port = '22';
|
||||||
|
// $create->username = 'root';
|
||||||
|
// $create->password = 'random-pass';
|
||||||
|
// $create->save();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue