[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-users] script to check for updates at Cobalt
- Subject: RE: [cobalt-users] script to check for updates at Cobalt
- From: "Loryan Strant" <cobalt-users@xxxxxxxxxx>
- Date: Tue Mar 6 05:55:05 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
Heya,
Why not add functionality to it so that it downloads the latest update into
a directory on the Cobalt, and notifies you of that? If I could code, I add
it myself, but I'm stupid. :-)
Loryan
-----Original Message-----
From: cobalt-users-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-users-admin@xxxxxxxxxxxxxxx]On Behalf Of Reinoud van
Leeuwen
Sent: Tuesday, 6 March 2001 11:39 PM
To: 'cobalt-users@xxxxxxxxxxxxxxx'
Subject: [cobalt-users] script to check for updates at Cobalt
I guess everybody, like myself, want's to stay on top of available packages
from Cobalt. So I've written a script that checks the webpage and will mail
you when something has changed.
Cron it every day as root and you have one thing less to check everyday.
(do not forget to change the email address to something suitable)
--------------- cut here ------------------
#!/bin/sh
####################################
# File: checkupdates
# Author: Reinoud van Leeuwen (reinoud.v@xxxxxxxxxxxxx)
# $Revision: 1.1 $
# Desc: Check the patches download page to see if it has
# Changed, and mail sombody that new patches might
# have appeared.
#
# $Log: checkupdates,v $
# Revision 1.1 2001/03/06 12:30:16 root
# Initial revision
#
####################################
# change email address to the address of the Cobalt administrator
#
export EMAIL=yourmail@xxxxxxxxxxxxxxx
# You will probably have to change nothing from here
#
export TESTDIR=~/checkupdates.dir
export TESTFILE=$TESTDIR/checkupdatepage.keep
export LOG=$TESTDIR/checkupdates.log
export URL=http://pkg.nl.cobalt.com/
export LYNX=/usr/bin/lynx
TMPFILE=`mktemp -q /tmp/$0.XXXXXX`
if [ $? -ne 0 ]; then
echo "$0: Can't create temp file, exiting..."
exit 1
fi
if [ ! -d $TESTDIR ]; then
mkdir -p $TESTDIR
fi
if [ ! -e $LOG ]
then
touch $LOG
fi
export TIME=`date`
$LYNX -dump $URL > $TMPFILE
if [ -e $TESTFILE ]
then
diff $TMPFILE $TESTFILE > /dev/null
if [ $? -eq 1 ]
then
# files different -> web page has changed!
echo "check $URL (brought to you by $0 on `hostname`)" | \
mail -s "new updates available? (Web page $URL has changed)" $EMAIL
echo "$TIME STATUS CHANGED! (mailed to $EMAIL)" >> $LOG
else
echo "$TIME nothing changed" >> $LOG
fi
fi
cp $TMPFILE $TESTFILE
rm $TMPFILE
----------- end of script -----------------------
_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users