--- a/rc.d/init.d/lighttpd +++ b/rc.d/init.d/lighttpd @@ -33,9 +33,11 @@ msg_reopen_logs() } ajust_docroot() { - docroot=$(fgrep server.document-root "$LIGHTTPD_CONF_PATH" |cut -d '=' -f2 |egrep -o "/.*" \ - |sed -e "s,\"$,,g") - [ -d "$docroot" ] || echo "docroot doesn't exist, creating it" && mkdir -p "$docroot" + fgrep server.document-root "$LIGHTTPD_CONF_PATH" |cut -d '=' -f2 |egrep -o "/.*" \ + |sed -e "s,\"$,,g" | \ + while read docroot; do + [ -d "$docroot" ] || echo "docroot '$docroot' doesn't exist, creating it" && mkdir -p "$docroot" + done } start() {