#!/bin/bash # Create a log of all the files for the package source `which ttPM-funcs` 2>/dev/null || exit 1 # Do not run as root checkNotRoot install -d $TT_PKG_LOCAL_DATA_DIR cd $TT_PKG_LOCAL_DATA_DIR for F in $(ls -v $TT_PKG_DATA_DIR/*.pkg 2>/dev/null) do P=`basename $F` P=${F%.pkg} DOWNLOAD="" source $F printMsg info "Checking if new version is available for $P..." if [ "z$DOWNLOAD" = "z" ] then continue fi # Read URIs from .download file, retrive and save to a temp .file wget --tries=1 --passive-ftp -O $P.file $DOWNLOAD || (setPkgFlag 2fixlink $TT_PKG_USERNAME ; error Unable to download) || exit 1 # If md5sum for site exists, check md5sum to see if something was updated. if [ -f $P.md5sum ] then md5sum -c --status $P.md5sum if [ $? = 0 ] then printMsg info "No update found" else setPkgFlag 2update $TT_PKG_USERNAME fi fi # Save md5sum for the retrived file md5sum $P.file > $P.md5sum # Delete tempfile #rm -f $P.file done