Advertisement
Guest User

Untitled

a guest
Apr 21st, 2016
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 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. // Success!
  8. echo 'success';
  9. }else{
  10. // Failure, $output has the details
  11. echo '<pre>';
  12. foreach($output as $o){
  13. echo $o."n";
  14. }
  15. echo '</pre>';
  16. }
  17. ?>
  18.  
  19. sudo: /etc/sudoers.d is world writable
  20. [sudo] password for daemon:
  21.  
  22. %admin ALL=(ALL) NOPASSWD: ALL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement