HOW-TO: Remove old webapps

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
10,628
Location
LT, EU
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):

Code:
#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;
 
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?
 
Back
Top