#!/bin/sh cd $HOME/news # check if we should save the existing linux file if grep -iq linux suck.linux ; then cp -f suck.linux suck.linux.save fi # if there is an existing output file, save it elsewhere. if [ -e output.linux ] ; then mv output.linux output.linux.1 fi # check if we are part way through a previous fetch # if we are, was it for linux or something else if [ -e suck.restart ] ; then if ! grep -iq linux suck.newrc ; then mv suck.restart suck.restart.save fi fi # start the new fetch cp -f suck.linux sucknewsrc suck news.alphalink.com.au > output.linux # now save the updated file if grep -iq linux suck.newrc ; then cp -f suck.newrc suck.linux fi # was a previous fetch interrupted, if so, restore the file if [ -e suck.restart.save ] ; then mv suck.restart.save suck.restart fi