#!/bin/bash LIGHTTPDCONF="lighttpd.conf" preview_lighttpd_conf() { cat <<_EOF server.document-root = "$(pwd)" server.port = 8080 index-file.names = ( "index.html" ) mimetype.assign = ( ".html" => "text/html", ".css" => "text/css", ".jpeg" => "image/jpeg", ".jpg" => "image/jpeg", ".png" => "image/png", ".gif" => "image/gif" ) _EOF } echo "Launching server for preview: http://localhost:8080/" preview_lighttpd_conf > "$LIGHTTPDCONF" lighttpd -D -f "$LIGHTTPDCONF"