Want more timely Centmin Mod News Updates?
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:
    7:35 AM
    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
     
    • Like Like x 1
  2. eva2000

    eva2000 Administrator Staff Member

    30,968
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    2:05 PM
    Nginx 1.13.x
    MariaDB 5.5
    can you post contents of your /root/tools/wp_uninstall_test.com.sh
     
  3. eva2000

    eva2000 Administrator Staff Member

    30,968
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    2:05 PM
    Nginx 1.13.x
    MariaDB 5.5
    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

    30,968
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    2:05 PM
    Nginx 1.13.x
    MariaDB 5.5
  5. JarylW

    JarylW Active Member

    216
    40
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +102
    Local Time:
    12:05 PM
    Noticed this some time ago but it stilled removed the folders correctly so i didnt think too much of it
     
    • Like Like x 1
  6. amin

    amin Member

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