slitaz-base-files rev 232

httphelper.sh: script should remove tmpdir
author Christophe Lincoln <pankso@slitaz.org>
date Sun Apr 13 01:29:34 2014 +0200 (2014-04-13)
parents 4c04399d78ff
children 2c88b0d80534
files rootfs/usr/lib/slitaz/httphelper.sh
line diff
     1.1 --- a/rootfs/usr/lib/slitaz/httphelper.sh	Sun Apr 13 01:27:05 2014 +0200
     1.2 +++ b/rootfs/usr/lib/slitaz/httphelper.sh	Sun Apr 13 01:29:34 2014 +0200
     1.3 @@ -139,6 +139,7 @@
     1.4  	read args < ${post}0
     1.5  	delim="${args%?}"
     1.6  	case "$delim" in
     1.7 +	
     1.8  	-*)	awk "/$delim/ { o+=index(\$0,\"$delim\")-1; print o }
     1.9  	   		  { o+=1+length() }" < ${post}0 | while read offset; do
    1.10  		    if [ $offset -ne 0 ]; then
    1.11 @@ -154,14 +155,17 @@
    1.12  		    filename=
    1.13  		    while read line; do
    1.14  			case "$line" in
    1.15 +			
    1.16  			*Content-Disposition*)
    1.17  			    name=$(echo $line | sed 's/.* name="\([^"]*\)".*$/\1/')
    1.18  			    name=${name%%[^A-Za-z_0-9]*}
    1.19  			    case "$line" in
    1.20  			    *filename=*) filename=$(echo $line | sed 's/.* filename="\([^"]*\)".*$/\1/') ;;
    1.21  			    esac ;;
    1.22 +			
    1.23  			*Content-Type*)
    1.24  			    type=$(echo $line | sed 's/.*-Type: \(.*\).$/\1/') ;;
    1.25 +			
    1.26  			$CR)
    1.27  			    if [ -n "$filename" ]; then
    1.28  				tmp=$(mktemp $prefix$$/uploadXXXXXX)
    1.29 @@ -195,8 +199,12 @@
    1.30  		    done < $i
    1.31  		    rm -f $i
    1.32  		done
    1.33 -		rmdir $(dirname $post) ;;
    1.34 -	*)	rm -rf $(dirname $post)
    1.35 +		#rmdir $(dirname $post) 
    1.36 +		;;
    1.37 +	
    1.38 +	*)	
    1.39 +		rm -rf $(dirname $post)
    1.40  		read_query_string POST "$args" ;;
    1.41 +	
    1.42  	esac
    1.43  fi