Get the most out of your Centmin Mod LEMP stack
Become a Member

Wordpress Uninstalling script issue

Discussion in 'Blogs & CMS usage' started by amin, Oct 13, 2015.

  1. amin

    amin Member

    38
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    3:34 PM
    Katest
    Latest
    I tried to remove a test website:


    /root/tools/wp_uninstall_test.com.sh
    /root/tools/wp_uninstall_test.com.sh: line 14: unexpected EOF while looking for matching `"'
    /root/tools/wp_uninstall_test.com.sh: line 18: syntax error: unexpected end of f ile
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,895
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    can you post contents of your /root/tools/wp_uninstall_test.com.sh
     
  3. eva2000

    eva2000 Administrator Staff Member

    54,895
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    ah found the bug some stray ending quotes " ended up on my rm -rf files

    incorrect
    Code:
    cat /root/tools/wp_uninstall_newdomain2.com.sh
    #/bin/bash
    rm -rf /usr/local/nginx/conf/conf.d/newdomain2.com.conf
    rm -rf /usr/local/nginx/conf/conf.d/newdomain2.com.ssl.conf
    rm -rf /home/nginx/domains/newdomain2.com
    rm -rf /usr/local/nginx/conf/wpsecure_newdomain2.com.conf
    rm -rf /usr/local/nginx/conf/wpsupercache_newdomain2.com.conf
    rm -rf /root/tools/wp_updater_newdomain2.com.sh
    rm -rf /usr/local/nginx/conf/ssl/newdomain2.com/newdomain2.com.crt"
    rm -rf /usr/local/nginx/conf/ssl/newdomain2.com/newdomain2.com.key"
    rm -rf /usr/local/nginx/conf/ssl/newdomain2.com/newdomain2.com.csr"
    rm -rf /usr/local/nginx/conf/ssl/newdomain2.com
    crontab -l > cronjoblist
    sed -i "/wp_updater_newdomain2.com.sh/d" cronjoblist
    sed -i "/\/newdomain2.com\/wp-cron.php/d" cronjoblist
    crontab cronjoblist
    rm -rf cronjoblist
    service nginx restart
    correct is to remove the ending " on these 3 lines
    Code:
    rm -rf /usr/local/nginx/conf/ssl/newdomain2.com/newdomain2.com.crt"
    rm -rf /usr/local/nginx/conf/ssl/newdomain2.com/newdomain2.com.key"
    rm -rf /usr/local/nginx/conf/ssl/newdomain2.com/newdomain2.com.csr"
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,895
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  5. JarylW

    JarylW Active Member

    216
    41
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +103
    Local Time:
    8:04 PM
    Noticed this some time ago but it stilled removed the folders correctly so i didnt think too much of it
     
  6. amin

    amin Member

    38
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    3:34 PM
    Katest
    Latest
    I think it would be good to add the command to remove the uninstallation file too.
    Thank you