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
use Illuminate\Support\Facades\Route;
use phpseclib3\Net\SSH2;
/*
|--------------------------------------------------------------------------
@ -25,13 +26,20 @@ Route::get('/', function () {
Route::get('dev', function () {
$create = new \App\Models\PhyreServer();
$create->name = 'hetzner1';
$create->ip = '37.27.28.220';
$create->port = '22';
$create->username = 'root';
$create->password = 'WTuiMuxqpdMLWv3b3Nxv';
$create->save();
$phyreServer = \App\Models\PhyreServer::find(15);
$ssh = new SSH2($phyreServer->ip);
if ($ssh->login($phyreServer->username, $phyreServer->password)) {
dd($ssh->exec('cat phyre-install.log'));
}
// $create = new \App\Models\PhyreServer();
// $create->name = 'hetzner1';
// $create->ip = 'random-ip';
// $create->port = '22';
// $create->username = 'root';
// $create->password = 'random-pass';
// $create->save();
});