tylercd100 / php-rebooter
This package will allow you to reboot, boot, and shutdown your servers remotely.
2.0.0
2016-04-21 21:08 UTC
Requires
- php: ^5.5.9|^7.0
- guzzlehttp/guzzle: ^6.2
- herzult/php-ssh: ^1.1
Requires (Dev)
- phpunit/phpunit: ^4.8|^5.0
This package is auto-updated.
Last update: 2024-12-12 10:05:54 UTC
README
This package will allow you to reboot, boot, and shutdown your servers remotely.
Currently supported:
- Linode
- DigitalOcean
- Vultr
- SSH with username and password
Planned support for:
- Amazon EC2
- SSH with more options
Installation
Install via composer - In the terminal:
composer require tylercd100/php-rebooter
Usage
Linode, DigitalOcean and Vultr
use Tylercd100\Rebooter\Drivers\Api\Linode; use Tylercd100\Rebooter\Drivers\Api\DigitalOcean; // DigitalOcean takes the same parameters as Linode use Tylercd100\Rebooter\Drivers\Api\Vultr; // Vultr takes the same parameters as Linode $token = "secret"; $server_id = 1234; $server = new Linode($token,$server_id); $server->reboot(); # or $server->boot(); # or $server->shutdown();
SSH Password
use Tylercd100\Rebooter\Drivers\Ssh\Password; $host = "your-server.com"; $user = "your-username"; $pass = "your-secret-password"; $port = 22; // The port parameter is optional and will default to 22 $server = new Password($host,$user,$pass,$port); $server->reboot(); # or $server->shutdown(); # or $server->boot(); // Will not work as you cannot boot a powered down maching using SSH