diff --git a/xfwc b/xfwc index 9de2699..c49c18b 100755 --- a/xfwc +++ b/xfwc @@ -2,7 +2,7 @@ ABSURL="https://xfnw.ttm.sh/xfwc" -cat < feed.rss +cat < feed.rss.new @@ -16,10 +16,6 @@ EOF TOTAL=$(ls src | wc -w) -rm index.html - -ln -s $TOTAL.html index.html - TOTAL=$(( TOTAL )) NUM=$(( TOTAL )) for fn in $(ls -t src); do @@ -33,7 +29,7 @@ echo " $ABSURL/$NEWF image #$NUM -" >> feed.rss +" >> feed.rss.new sed "s//$TITLE/; s/XFSSTITLE/$TITLE/g; s/RANDOM/"$(( ( RANDOM % TOTAL ) + 1 ))"/; s/LAST/$TOTAL/" template/page.html > $NEWF @@ -46,9 +42,11 @@ NUM=$(( NUM - 1 )) done -cat <> feed.rss +cat <> feed.rss.new EOF +ln -s $TOTAL.html index.html +mv feed.rss.new feed.rss