Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <h1>Inded Developed Swift Panel</h1>
- <h2>Server Name |||||||||||||||<?php
- if(isset($_GET['action'])){
- $action=$_GET['action'];
- include_once('Net/SSH2.php');
- $ssh = new Net_SSH2('192.168.1.4');
- if (!$ssh->login('root', 'p@ss123')) {
- exit('Login Failed');
- }
- if($action=="Start"){
- $ssh->exec('screen -dm -S user1');
- $ssh->exec('screen -x user1');
- echo $ssh->shell_exec('cd /home/user1/');
- echo $ssh->shell_exec('java -Xmx1048M -Xms1048M -jar server.jar nogui');
- }
- else if($action=="Stop"){
- $ssh->exec('screen -S user1');
- //$ssh->exec('stop');
- $ssh->exec('screen -X -S user1 quit');
- }
- else if($action=="Restart"){
- //commands
- }
- }
- ?>
- <html>
- <form action="<?php $_PHP_SELF ?>">
- <input type="submit" name="action" value="Start">
- <input type="submit" name="action" value="Stop">
- <input type="submit" name="action" value="Restart">
- </form>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement