-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restart services, open in term/iterm
- Loading branch information
1 parent
8748f35
commit 7d86086
Showing
7 changed files
with
852 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace AlForge; | ||
|
||
use AlForge\Forge; | ||
use Alfred\Workflows\Workflow; | ||
|
||
class Mysql extends Forge | ||
{ | ||
public function search($query) | ||
{ | ||
echo $this->serverSearch($query); | ||
} | ||
|
||
public function execute($server_id) | ||
{ | ||
$server = $this->getServerInfo($server_id); | ||
|
||
if($this->confirm("Are you sure you want to restart MYSQL on `$server->name`?")){ | ||
$response = $this->apiRequest("https://forge.laravel.com/api/v1/servers/$server->id/mysql/reboot"); | ||
$this->respond( | ||
"Command sent to Forge", | ||
["push_title" => "Restarting MYSQL on `$server->name`"] | ||
); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace AlForge; | ||
|
||
use AlForge\Forge; | ||
use Alfred\Workflows\Workflow; | ||
|
||
class Nginx extends Forge | ||
{ | ||
public function search($query) | ||
{ | ||
echo $this->serverSearch($query); | ||
} | ||
|
||
public function execute($server_id) | ||
{ | ||
$server = $this->getServerInfo($server_id); | ||
|
||
if($this->confirm("Are you sure you want to restart Nginx on `$server->name`?")){ | ||
$response = $this->apiRequest("https://forge.laravel.com/api/v1/servers/$server->id/nginx/reboot"); | ||
$this->respond( | ||
"Command sent to Forge", | ||
["push_title" => "Restarting Nginx on `$server->name`"] | ||
); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace AlForge; | ||
|
||
use AlForge\Forge; | ||
use Alfred\Workflows\Workflow; | ||
|
||
class Postgres extends Forge | ||
{ | ||
public function search($query) | ||
{ | ||
echo $this->serverSearch($query); | ||
} | ||
|
||
public function execute($server_id) | ||
{ | ||
$server = $this->getServerInfo($server_id); | ||
|
||
if($this->confirm("Are you sure you want to restart Postgres on `$server->name`?")){ | ||
$response = $this->apiRequest("https://forge.laravel.com/api/v1/servers/$server->id/postgres/reboot"); | ||
$this->respond( | ||
"Command sent to Forge", | ||
["push_title" => "Restarting Postgres on `$server->name`"] | ||
); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace AlForge; | ||
|
||
use AlForge\Forge; | ||
use Alfred\Workflows\Workflow; | ||
|
||
class Term extends Forge | ||
{ | ||
public function search($query) | ||
{ | ||
echo $this->serverSearch($query); | ||
} | ||
|
||
public function execute($server_id) | ||
{ | ||
$server = $this->getServerInfo($server_id); | ||
|
||
echo $server->ip_address; | ||
|
||
// $query = "ssh forge@$server->ip_address"; | ||
|
||
// exec("osascript -e 'tell application \"Terminal\" to do script \"$query\"'"); | ||
// exec("osascript -e 'activate application \"Terminal\"'"); | ||
} | ||
} |
Oops, something went wrong.