#!/bin/bash # get new vesions of scripts and any new scripts prefix='files/xymon-ext' DEST=$(echo ~xymon/client/ext) URI="http://repo.hpc.lsu.edu/${prefix}" scriptFile='scripts.txt' scriptList="${URI}/${scriptFile}" scriptPath="/tmp/${scriptFile}" cd ${DEST} rm -f ${scriptPath} # echo 'Downloading script list' wget "${scriptList}" --output-document=${scriptPath} >/dev/null 2>/dev/null cat ${scriptPath} | while read line do set ${line} sum="$1" file="$2" # sum of 0 says file should be deleted if [[ -f ${DEST}/${file} ]] then local=$(sha1sum ${DEST}/${file} | awk '{print $1}') if [[ "${local}" != "${sum}" ]] then echo "${file} needs to be updated" fi fi done