All pastes #567294 Raw Edit

Something

public shellscript v1 · immutable
·published 2007-06-14 22:37 UTC
rendered paste body
DATSITE="ftp://ftp.nai.com"DATPATH="/pub/datfiles/english/dat-XXXX.tar"  # Template pathINIPATH="/pub/datfiles/english/update.ini"    # Actual path# Sloppy hack to determine the latest DAT file release by parsing it# out of the update.ini file.get_latest_ver(){    datversion=$(/usr/bin/ftp -o - ${DATSITE}${INIPATH} 2>/dev/null \        |grep ^DATVersion |head -n1 |cut -d= -f2)    if [ "$datversion" = "" ]; then        return 1    else        echo -n $datversion    fi}DATVER=`get_latest_ver` || {    echo "ERROR: could not determine latest DAT version." && exit 1 ; }# Build path containing latest dat file name for retrieval.echo $DATPATH | sed -e s,XXXX,${DATVER},