tinycm rev 34

check if cache dir is writable
author Christophe Lincoln <pankso@slitaz.org>
date Mon Jan 06 21:32:52 2014 +0000 (2014-01-06)
parents 4521322899ee
children 6172acda8b17
files index.cgi
line diff
     1.1 --- a/index.cgi	Mon Jan 06 21:22:04 2014 +0000
     1.2 +++ b/index.cgi	Mon Jan 06 21:32:52 2014 +0000
     1.3 @@ -730,14 +730,20 @@
     1.4  		html_header
     1.5  		user_box
     1.6  		get_lang
     1.7 -		# Generate a default index on first run.
     1.8 +		# Generate a default index on first run
     1.9  		if [ ! -f "$wiki/$index.txt" ]; then
    1.10 -			default_index
    1.11 -			if [ ! -f "$wiki/$index.txt" ]; then
    1.12 -				echo "<pre class='error'>Directory: content/ is not writable</pre>"
    1.13 +			if ! default_index; then
    1.14 +				echo "<pre class='error'>Directory : content/ is not writable"
    1.15  				html_footer && exit 0
    1.16  			fi
    1.17  		fi
    1.18 +		# Check cache dir
    1.19 +		if [ ! -w "$cache" ]; then
    1.20 +			echo "<pre class='error'>Directory : cache/ is not writable"
    1.21 +			echo "Command   : install -m 0777 -d $tiny/cache</pre>"
    1.22 +			html_footer && exit 0
    1.23 +		fi
    1.24 +		# Wiki document
    1.25  		if [ ! -f "$wiki/$d.txt" ]; then
    1.26  			echo "<h2>$d</h2>"
    1.27  			gettext "The document does not exist. You can create it or read the"