Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. <html>
  2. <h1>Inded Developed Swift Panel</h1>
  3. <h2>Server Name |||||||||||||||<?php
  4.  
  5. if(isset($_GET['action'])){
  6. $action=$_GET['action'];
  7. include_once('Net/SSH2.php');
  8.  
  9. $ssh = new Net_SSH2('192.168.1.4');
  10. if (!$ssh->login('root', 'p@ss123')) {
  11. exit('Login Failed');
  12. }
  13.  
  14. if($action=="Start"){
  15. $ssh->exec('screen -dm -S user1');
  16. $ssh->exec('screen -x user1');
  17. echo $ssh->shell_exec('cd /home/user1/');
  18. echo $ssh->shell_exec('java -Xmx1048M -Xms1048M -jar server.jar nogui');
  19. }
  20. else if($action=="Stop"){
  21. $ssh->exec('screen -S user1');
  22. //$ssh->exec('stop');
  23. $ssh->exec('screen -X -S user1 quit');
  24. }
  25. else if($action=="Restart"){
  26. //commands
  27. }
  28.  
  29. }
  30. ?>
  31. <html>
  32. <form action="<?php $_PHP_SELF ?>">
  33. <input type="submit" name="action" value="Start">
  34. <input type="submit" name="action" value="Stop">
  35. <input type="submit" name="action" value="Restart">
  36. </form>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement