commit f83e7a76cf42afd11c49741716cb838467b14b37 from: mischa date: Sat Jun 03 19:03:51 2023 UTC don't diff when rss doesn't exist commit - 3991a31f5415c93429ed715ee736bb0dcd8e84d2 commit + f83e7a76cf42afd11c49741716cb838467b14b37 blob - 4601d413cec43b167f7af1299dd58525599a9e21 blob + d1cf2a048e380e84163da4c78b91361e5019b310 --- uptimeatomic +++ uptimeatomic @@ -298,9 +298,14 @@ cat << EOF >> ${_RSSFILE} EOF fi -_diff=$(diff "${_RSSFILE}" "${HTMLDIR}/${RSS_FILE}" | wc -l) -if [ "${_diff}" -ne "4" ]; then +if [ -s "${HTMLDIR}/${RSS_FILE}" ]; then + _diff=$(diff "${_RSSFILE}" "${HTMLDIR}/${RSS_FILE}" | wc -l) + if [ "${_diff}" -ne "4" ]; then + cp ${_RSSFILE} ${HTMLDIR}/${RSS_FILE} + fi +else cp ${_RSSFILE} ${HTMLDIR}/${RSS_FILE} fi + cp ${_HTMLFILE} ${HTMLDIR}/${HTMLFILE} rm -r "${_TMP}" 2>/dev/null