Guest User

Untitled

a guest
Sep 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ROOTPASS="password"
  4.  
  5. echo "Enter username to delete:"
  6. read USERNAME
  7.  
  8. mysql -uroot --password=$ROOTPASS -e "DROP USER $USERNAME@localhost"
  9. mysql -uroot --password=$ROOTPASS -e "DROP DATABASE $USERNAME"
  10. rm -f /etc/nginx/sites-enabled/$USERNAME.conf
  11. rm -f /etc/nginx/sites-available/$USERNAME.conf
  12. rm -f /etc/php5/fpm/pool.d/$USERNAME.conf
  13. find /var/log/nginx/ -type f -name "$USERNAME-*" -exec rm '{}' \;
  14.  
  15. service nginx reload
  16. service php5-fpm reload
  17.  
  18. userdel -rf $USERNAME
Add Comment
Please, Sign In to add comment