--- /etc/init.d/lighttpd 2009-06-20 13:04:34.000000000 +0200 +++ lighttpd 2009-07-07 13:05:23.000000000 +0200 @@ -18,6 +17,21 @@ return 1 fi + local -i free_space + local fs + + if [[ `mount | grep \/var` -eq 0 ]]; then + fs='/var' + else + fs='rootfs' + fi + + free_space=`df | grep $fs | gawk '{ print $3 }'` + if [[ $free_space < 2048 ]]; then + ewarn "$fs has few disk space ($free_space) left, lighttpd will bug" + return 1 + fi + /usr/sbin/lighttpd -t -f ${LIGHTTPD_CONF} >/dev/null }