wok diff tazwikiss/receipt @ rev 18730

Quote root dir in post_install
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Dec 20 15:13:45 2015 +0100 (2015-12-20)
parents f9743cf20afc
children 77be6b57303b
line diff
     1.1 --- a/tazwikiss/receipt	Mon Nov 30 01:53:13 2015 +0200
     1.2 +++ b/tazwikiss/receipt	Sun Dec 20 15:13:45 2015 +0100
     1.3 @@ -33,15 +33,15 @@
     1.4  {
     1.5  	server=busybox
     1.6  	# Configure lighttpd server
     1.7 -	if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
     1.8 +	if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
     1.9  		server=lighttpd
    1.10 -		if ! grep -q '"/wiki/"'  $1/etc/lighttpd/lighttpd.conf; then
    1.11 +		if ! grep -q '"/wiki/"' "$1/etc/lighttpd/lighttpd.conf"; then
    1.12  	    		sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\
    1.13    cgi.assign = (\
    1.14      ".sh" => "/bin/sh"\
    1.15    )\
    1.16    index-file.names = ( "index.sh" )\
    1.17 -}\n\n&|' -i $1/etc/lighttpd/lighttpd.conf
    1.18 +}\n\n&|' -i "$1/etc/lighttpd/lighttpd.conf"
    1.19  			if [ -z "$1" ]; then
    1.20  				# Start Web server.
    1.21  				/etc/init.d/lighttpd stop
    1.22 @@ -50,10 +50,10 @@
    1.23  		fi
    1.24  	fi
    1.25  	# Configure apache server
    1.26 -	if [ -f $1/etc/apache/httpd.conf ]; then
    1.27 +	if [ -f "$1/etc/apache/httpd.conf" ]; then
    1.28  		server=apache
    1.29 -		if [ ! -f $1/etc/apache/conf.d/tazwikiss ]; then
    1.30 -			cat > $1/etc/apache/conf.d/tazwikiss <<EOT
    1.31 +		if [ ! -f "$1/etc/apache/conf.d/tazwikiss" ]; then
    1.32 +			cat > "$1/etc/apache/conf.d/tazwikiss" <<EOT
    1.33  <DirectoryMatch /var/www/wiki/>
    1.34      Options +ExecCGI
    1.35      AddHandler cgi-script .sh
    1.36 @@ -73,9 +73,9 @@
    1.37  	fi
    1.38  	# Configure busybox/httpd server by default
    1.39  	if [ "$server" == "busybox" ]; then
    1.40 -		sed -i 's/lighttpd/httpd/' $1/etc/rcS.conf
    1.41 -		if [ ! -s $1/etc/httpd.conf ]; then
    1.42 -			cat > $1/etc/httpd.conf <<EOT
    1.43 +		sed -i 's/lighttpd/httpd/' "$1/etc/rcS.conf"
    1.44 +		if [ ! -s "$1/etc/httpd.conf" ]; then
    1.45 +			cat > "$1/etc/httpd.conf" <<EOT
    1.46  H:/var/www
    1.47  A:0.0.0.0/0
    1.48  .xml:text/xml
    1.49 @@ -85,13 +85,13 @@
    1.50  EOT
    1.51  		fi
    1.52  		while read line; do
    1.53 -			grep -q "$line" $1/etc/httpd.conf && continue
    1.54 -			echo "$line" >> $1/etc/httpd.conf
    1.55 +			grep -q "$line" "$1/etc/httpd.conf" && continue
    1.56 +			echo "$line" >> "$1/etc/httpd.conf"
    1.57  		done <<EOT
    1.58  *.sh:/bin/sh
    1.59  EOT
    1.60 -		grep -q ' httpd ' $1/etc/rcS.conf ||
    1.61 -		sed -i 's/ slim"/ httpd slim"/' $1/etc/rcS.conf
    1.62 +		grep -q ' httpd ' "$1/etc/rcS.conf" ||
    1.63 +		sed -i 's/ slim"/ httpd slim"/' "$1/etc/rcS.conf"
    1.64  		if [ -z "$1" ]; then
    1.65  			# Start Web server.
    1.66  			/etc/init.d/httpd stop
    1.67 @@ -99,7 +99,7 @@
    1.68  		fi
    1.69  	fi
    1.70  	while read line; do
    1.71 -		[ -x $1/$line ] && continue
    1.72 +		[ -x "$1/$line" ] && continue
    1.73  		echo "WARNING: $line not found, $PACKAGE will not work !"
    1.74  	done <<EOT
    1.75  /usr/sbin/httpd