wok-next rev 8651

Fix wordpress post_remove.
author Christopher Rogers <slaxemulator@gmail.com>
date Tue Feb 15 20:00:18 2011 +0000 (2011-02-15)
parents 2b67361247e5
children df3ccb15ee3c
files wordpress/receipt
line diff
     1.1 --- a/wordpress/receipt	Tue Feb 15 19:58:17 2011 +0000
     1.2 +++ b/wordpress/receipt	Tue Feb 15 20:00:18 2011 +0000
     1.3 @@ -14,7 +14,6 @@
     1.4  # Rules to gen a SliTaz package suitable for Tazpkg.
     1.5  genpkg_rules()
     1.6  {
     1.7 -	src=$WOK/$PACKAGE/$PACKAGE
     1.8  	mkdir -p $fs/var/www/wordpress
     1.9  	cp -a $src/* $fs/var/www/wordpress
    1.10  	chown -R www.www $fs/var/www/wordpress
    1.11 @@ -51,17 +50,18 @@
    1.12  
    1.13  post_remove()
    1.14  {
    1.15 -		local db=wordpress
    1.16 -		local db_user=wordpress
    1.17 -		local db_password=wordpress
    1.18 +	local db=wordpress
    1.19 +	local db_user=wordpress
    1.20 +	local db_password=wordpress
    1.21  	
    1.22 +	if [ -z $1 ]; then
    1.23  		echo -n "Would you like to remove data and database files.(y/n) "
    1.24  		read answer
    1.25  
    1.26  		case $answer in 
    1.27  		y|Y)
    1.28  			echo -n "Removing data directories..."
    1.29 -			rm -rf /var/lib/wordpress ; status
    1.30 +			[ -d /var/lib/wordpress ] && rm -rf /var/lib/wordpress ; status
    1.31  			if ( mysql -u root -Be 'show databases' | grep -q $db ); then
    1.32  				echo -n "Deleting $db database"
    1.33  				mysql -Be "drop database $db" ; status
    1.34 @@ -75,4 +75,5 @@
    1.35  		*)
    1.36  			;;
    1.37  		esac
    1.38 +	fi
    1.39  }