Checking for Updated Packages
I used to think the packages for a six month release never changed, but that's not true.
I was reading a while back on the list where packages aren't currently being updated,
but I think it's due to mostly a lack of resources, not anyone just deciding they weren't
going to do it any longer. I do know in OpenBSD 4.1 I updated some packages about two
months ago. So, in the future, when there are again some package updates for whatever
particular version of OpenBSD you're running, you can try this script I kludged together
the other night. Like everything else I put up here, it's been tested. That's not to say
you might not run into problems. I didn't once I ironed out a few mistakes I'd made in it.
I got the idea originally from my favorite BSD guru, Dru Lavigne. The article is at:
Hack #51. Get the Most Out of FTP
Here's my version of ~/.netrc with the email changed to protect the guilty. :-)
machine rt.fmWhere it says machine, you can change that to which ever server you prefer to use. Also,
login anonymous
password your@email
macdef obsd
bin
bell
prompt
cd pub/OpenBSD/4.1/packages/i386/
ls -l pkgdirlistnew.txt
bye
#!/bin/shSo, here's what happens when you run the shell script ftpmac.sh:
#
echo $ obsd | ftp rt.fm
infile1=pkgdirlistnew.txt
infile2=pkgdirlist.txt
if [ ! -f $infile ]; then
echo "Input file [$infile] not found"
exit
fi
#
diff pkgdirlistnew.txt pkgdirlist.txt > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "No Changes Today!"
exit
fi
echo "There are changes in directory listing!" && \
diff pkgdirlistnew.txt pkgdirlist.txt > `date +"%Y%m%d"`newchgs.txt
mail -s "`/bin/hostname` Package Changes" username < `date +"%Y%m%d"`newchgs.txt
echo "Recent package changes in `date +"%Y%m%d"`newchgs.txt"
mv pkgdirlistnew.txt pkgdirlist.txt
59 7 * * 5 $HOME/bin/ftpmac.sh > /dev/null 2>&1Back to Tips and Tricks
No affiliation between this site and the OpenBSD project exists or is implied.