Skip to content

Instantly share code, notes, and snippets.

@valumar
Created March 17, 2016 12:19
Show Gist options
  • Select an option

  • Save valumar/55f8a02786cf48468a5b to your computer and use it in GitHub Desktop.

Select an option

Save valumar/55f8a02786cf48468a5b to your computer and use it in GitHub Desktop.

Revisions

  1. @bezumkin bezumkin revised this gist Jul 22, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion remove.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/bin/bash

    ROOTPASS="password"
    ROOTPASS='password'

    echo "Enter username to delete:"
    read USERNAME
  2. @bezumkin bezumkin revised this gist Apr 17, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion remove.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    !/bin/bash
    #!/bin/bash

    ROOTPASS="password"

  3. @bezumkin bezumkin revised this gist Mar 26, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions remove.sh
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,7 @@ mysql -uroot --password=$ROOTPASS -e "DROP DATABASE $USERNAME"
    rm -f /etc/nginx/sites-enabled/$USERNAME.conf
    rm -f /etc/nginx/sites-available/$USERNAME.conf
    rm -f /etc/php5/fpm/pool.d/$USERNAME.conf
    find /var/log/nginx/ -type f -name "$USERNAME-*" -exec rm '{}' \;

    service nginx reload
    service php5-fpm reload
  4. @bezumkin bezumkin renamed this gist Mar 24, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. @bezumkin bezumkin revised this gist Mar 24, 2012. 2 changed files with 17 additions and 11 deletions.
    17 changes: 17 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    !/bin/bash

    ROOTPASS="password"

    echo "Enter username to delete:"
    read USERNAME

    mysql -uroot --password=$ROOTPASS -e "DROP USER $USERNAME@localhost"
    mysql -uroot --password=$ROOTPASS -e "DROP DATABASE $USERNAME"
    rm -f /etc/nginx/sites-enabled/$USERNAME.conf
    rm -f /etc/nginx/sites-available/$USERNAME.conf
    rm -f /etc/php5/fpm/pool.d/$USERNAME.conf

    service nginx reload
    service php5-fpm reload

    userdel -rf $USERNAME
    11 changes: 0 additions & 11 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,11 +0,0 @@
    #!/bin/bash
    source modx.cfg

    echo "Enter username to delete:"
    read USERNAME

    mysql -uroot --password=$MYSQLPASS -e "DROP USER $USERNAME@localhost"
    mysql -uroot --password=$MYSQLPASS -e "DROP DATABASE $USERNAME"
    rm -f /etc/apache2/sites-enabled/$USERNAME.conf
    userdel -rf $USERNAME
    /etc/init.d/apache2 reload
  6. @NoPizzaNoGlory NoPizzaNoGlory created this gist Feb 8, 2012.
    11 changes: 11 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #!/bin/bash
    source modx.cfg

    echo "Enter username to delete:"
    read USERNAME

    mysql -uroot --password=$MYSQLPASS -e "DROP USER $USERNAME@localhost"
    mysql -uroot --password=$MYSQLPASS -e "DROP DATABASE $USERNAME"
    rm -f /etc/apache2/sites-enabled/$USERNAME.conf
    userdel -rf $USERNAME
    /etc/init.d/apache2 reload