PDA

View Full Version : HOW-TO: Remove old webapps



smtalk
06-25-2008, 05:45 AM
I think I'll include it into CustomBuild soon. This code removes old web applications (e.g. if you have phpMyAdmin 2.11.5, 2.11.6 and 2.11.7 installed it will remove 2.11.5 and 2.11.6):



#Clean phpMyAdmin
PHPMYADMIN_CUR=`ls -l /var/www/html/phpMyAdmin | cut -d\> -f2 | cut -d- -f2`
for i in `ls -d /var/www/html/phpMyAdmin-*/ | grep -v "${PHPMYADMIN_CUR}"`; do { rm -rf $i; echo "Removing $i..."; }; done;

#Clean SquirrelMail
SQUIRRELMAIL_CUR=`ls -l /var/www/html/squirrelmail | cut -d\> -f2 | cut -d- -f2`
for i in `ls -d /var/www/html/squirrelmail-*/ | grep -v "${SQUIRRELMAIL_CUR}"`; do { rm -rf $i; echo "Removing $i..."; }; done;

#Clean Atmail
ATMAIL_CUR=`ls -l /var/www/html/atmail | cut -d\> -f2 | cut -d- -f2`
for i in `ls -d /var/www/html/atmail-*/ | grep -v "${ATMAIL_CUR}"`; do { rm -rf $i; echo "Removing $i..."; }; done;

#Clean RoundCube
ROUNDCUBE_CUR=`ls -l /var/www/html/roundcube | cut -d\> -f2 | cut -d- -f2`
for i in `ls -d /var/www/html/roundcube-*/ | grep -v "${ROUNDCUBE_CUR}"`; do { rm -rf $i; echo "Removing $i..."; }; done;

sintsu
09-13-2008, 08:27 AM
Hi smtalk, I would like to know if this remove code add into the "build file" in CustomBuild, what argument shoud i type behind the build? Is ./build clean "web application" right?

smtalk
09-13-2008, 08:36 AM
It's not yet included into a stable release of the CustomBuild script. This code is only available in http://files.directadmin.com/services/custombuild/beta/ at the moment. You can run that code manually too (if you want).