Skip to content

Commit ec5c62e

Browse files
author
David Barnes
committed
Add TunnelerReset
1 parent 1c0b8ec commit ec5c62e

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

src/Console/TunnelerReset.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
namespace STS\Tunneler\Console;
3+
4+
use Illuminate\Console\Command;
5+
use STS\Tunneler\Jobs\CreateTunnel;
6+
7+
class TunnelerReset extends Command
8+
{
9+
/**
10+
* The name and signature of the console command.
11+
*
12+
* @var string
13+
*/
14+
protected $signature = 'tunneler:reset';
15+
16+
/**
17+
* The console command description.
18+
*
19+
* @var string
20+
*/
21+
protected $description = 'Destroy and reconnect the SSH tunnel';
22+
23+
/**
24+
* Create a new command instance.
25+
*
26+
* @return void
27+
*/
28+
public function __construct()
29+
{
30+
parent::__construct();
31+
}
32+
33+
/**
34+
* Execute the console command.
35+
*
36+
* @return int
37+
*/
38+
public function handle()
39+
{
40+
$tunnel = new CreateTunnel();
41+
return 0;
42+
}
43+
}

src/TunnelerServiceProvider.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Illuminate\Support\ServiceProvider;
44
use STS\Tunneler\Console\TunnelerCommand;
5+
use STS\Tunneler\Console\TunnelerReset;
56
use STS\Tunneler\Jobs\CreateTunnel;
67

78

@@ -50,6 +51,14 @@ function ($app) {
5051
);
5152

5253
$this->commands('command.tunneler.activate');
54+
55+
$this->app->singleton('command.tunneler.reset',
56+
function ($app) {
57+
return new TunnelerReset();
58+
}
59+
);
60+
61+
$this->commands('command.tunneler.reset');
5362
}
5463

5564
/**

0 commit comments

Comments
 (0)