Update web.php

This commit is contained in:
Bozhidar Slaveykov 2024-04-07 01:06:55 +03:00
parent 19ef66abd4
commit 881537c9c6

View file

@ -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();
}); });