Compare commits

..

No commits in common. "a8f70e892cce90b2e2a9dad8e89028e7fb19527e" and "733168e4b6330ce3a917bfa827af47a25f9e8213" have entirely different histories.

2 changed files with 10 additions and 21 deletions

View File

@ -115,11 +115,10 @@ else
fi fi
## update files ## update files
# remember: do NOT quote dummy var! set -- dummy "$updateFiles"
set -- dummy $updateFiles
shift shift
for file; do for file; do
printf "checking '%s' for updates... " "$file" printf "\nchecking '%s' for updates... " "$file"
repoFileChecksum=$( grep "$file" "$checksumFilename" | grep -o '^\S*' ) repoFileChecksum=$( grep "$file" "$checksumFilename" | grep -o '^\S*' )
if [ -f "$file" ]; then if [ -f "$file" ]; then
localFileChecksum=$( sha256sum "$file" | grep -o '^\S*' ) localFileChecksum=$( sha256sum "$file" | grep -o '^\S*' )
@ -127,14 +126,15 @@ for file; do
localFileChecksum=0 localFileChecksum=0
fi fi
if ! [ "$localFileChecksum" = "$repoFileChecksum" ]; then if ! [ "$localFileChecksum" = "$repoFileChecksum" ]; then
printf "%s[AVAILABLE]%s " "$yellow" "$norm" printf "%s[AVAILABLE]%s\n" "$yellow" "$norm"
updatesAvailable=$((updatesAvailable+1)) updatesAvailable=$((updatesAvailable+1))
# download update # download update
printf "Downloading updated '%s'... " "$file"
if ! wget --quiet --tries=3 --timeout=10 -O "$file" "$serverPath$file"; then if ! wget --quiet --tries=3 --timeout=10 -O "$file" "$serverPath$file"; then
printf "%s[ERROR]%s\n" "$err" "$norm" printf "%s[ERROR]%s\n\n" "$err" "$norm"
downloadFailed=$((downloadFailed+1)) downloadFailed=$((downloadFailed+1))
else else
printf "%s[DOWNLOADED] %s" "$ok" "$norm" printf "%s[OK] %s" "$ok" "$norm"
downloadSuccess=$((downloadSuccess+1)) downloadSuccess=$((downloadSuccess+1))
# verify download # verify download
localFileChecksum=$( sha256sum "$file" | grep -o '^\S*' ) localFileChecksum=$( sha256sum "$file" | grep -o '^\S*' )
@ -155,18 +155,7 @@ done
### display results ### display results
printf "\n%sResults:%s\n" "$cyan" "$norm" printf "\n%sResults:%s\n" "$cyan" "$norm"
printf "\tUpdates: %s available\n" "$updatesAvailable" printf "\tUpdates: %s available\n" "$updatesAvailable"
if [ "$updatesAvailable" -gt '0' ]; then printf "\tDownloads: %s successful, %s%s failed%s\n" "$downloadSuccess" "$err" "$downloadFailed" "$norm"
if [ "$downloadFailed" -gt '0' ]; then printf "\tUpdates: %s applied, %s%s failed%s\n" "$updateSuccess" "$err" "$updateFailed" "$norm"
printf "\tDownloads: %s successful, %s%s failed%s\n" "$downloadSuccess" "$err" "$downloadFailed" "$norm"
else
printf "\tDownloads: %s successful\n" "$downloadSuccess"
fi
if [ "$updateFailed" -gt '0' ]; then
printf "\tUpdates: %s applied, %s%s failed%s\n\n" "$updateSuccess" "$err" "$updateFailed" "$norm"
else
printf "\tUpdates: %s applied\n\n" "$updateSuccess"
fi
fi
exit 0
#EOF exit 0

View File

@ -2,4 +2,4 @@ a4ff46220c20887c85dbd9f4cc3d455bddeb920701966693bc277fb0690e9272 ab-openldap-ba
206d756846839c13574adef3acec9a9475e0212904bd44c336414160dfeb7bb1 ab-openldap-backup.sh 206d756846839c13574adef3acec9a9475e0212904bd44c336414160dfeb7bb1 ab-openldap-backup.sh
a2ae75864833c517aa686bbef02cd22864f305a42013c02d44df0008e4f2995e ab-openldap.params.template a2ae75864833c517aa686bbef02cd22864f305a42013c02d44df0008e4f2995e ab-openldap.params.template
c0d949a47ece205e8b9f31ec7376491a75a39865a3affba85b349982f5519297 ab-openldap.sh c0d949a47ece205e8b9f31ec7376491a75a39865a3affba85b349982f5519297 ab-openldap.sh
ed4091788e258c545a13c061459e4d206f8edd98b79abdcc8052aad43acb405b ab-openldap-update.sh 2d5ccdfa11943edf5f29cd65bc5d597f47bb702f8f85924b14a55042d13bb3d9 ab-openldap-update.sh