Advertisement
Guest User

Untitled

a guest
Apr 20th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2. $username = 'hello';
  3. $password = 'hello';
  4. $node = 'my ip';
  5. exec('sudo -S ejabberd /usr/sbin/ejabberdctl register '.$username.' '.$node.' '.$password.' 2>&1',$output,$status);
  6. if($output == 0)
  7. {
  8. // Success!
  9. echo 'success';
  10. }
  11. else
  12. {
  13. // Failure, $output has the details
  14. echo '<pre>';
  15. foreach($output as $o)
  16. {
  17. echo $o."n";
  18. }
  19. echo '</pre>';
  20. }
  21. ?>
  22.  
  23. sudo: /etc/sudoers.d is world writable
  24. [sudo] password for daemon:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement