This script downloads new md5.txt files and checks against apps in the tce-directory. Results are
written to /tmp/update-check (for tinycore_2)
edit: correct test for /tmp/update-check
edit2: add cleanup
#!/bin/ash
#### by jpeters for tinycore-2 (current-version 5/11/09) TESTING ####
[ -f /tmp/update-check ] && sudo rm /tmp/update-check
TCEDIR="$(cat /opt/.tce_dir)"
cd $TCEDIR
# Create {tce,tcz} md5.txt lists
TCE="$(ls | grep txt | grep tce | grep -v tcz)"
TCZ="$(ls | grep txt | grep tcz | grep -v tce)"
# Create work directory
[ -d /tmp/md5 ] || mkdir /tmp/md5
cd /tmp/md5
# Download md5.txt files from tcz directory
TCZFTP="ftp://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/2.x/tcz"
for I in $TCZ
do
sudo wget $TCZFTP/$I
done
# Download md5.txt files from tce directory
TCEFTP="ftp://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/2.x/tce"
for I in $TCE
do
sudo wget $TCEFTP/$I
done
# md5check: Results in /tmp/update-tce
cd $TCEDIR
for I in $TCE
do
CK="$(md5sum -c /tmp/md5/$I)"
echo $CK >>/tmp/update-check
done
# md5Check: Results in /tmp/update-tcz
for I in $TCZ
do
CK="$(md5sum -c /tmp/md5/$I)"
echo $CK >>/tmp/update-check
done
echo "********************************************"
echo "MD5SUM FAILURES...(MISSING OR REQUIRE UPDATE)"
echo "********************************************"
echo " "
cat /tmp/update-check | grep FAILED
## cleanup
sudo rm -R /tmp/md5 &>/dev/null