Compare commits
6 Commits
733168e4b6
...
a8f70e892c
Author | SHA1 | Date | |
---|---|---|---|
|
a8f70e892c | ||
|
65cebd4845 | ||
|
d3eab06714 | ||
|
ca82b501cb | ||
|
c80374f971 | ||
|
b81619376a |
@ -115,10 +115,11 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
## update files
|
## update files
|
||||||
set -- dummy "$updateFiles"
|
# remember: do NOT quote dummy var!
|
||||||
|
set -- dummy $updateFiles
|
||||||
shift
|
shift
|
||||||
for file; do
|
for file; do
|
||||||
printf "\nchecking '%s' for updates... " "$file"
|
printf "checking '%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*' )
|
||||||
@ -126,15 +127,14 @@ for file; do
|
|||||||
localFileChecksum=0
|
localFileChecksum=0
|
||||||
fi
|
fi
|
||||||
if ! [ "$localFileChecksum" = "$repoFileChecksum" ]; then
|
if ! [ "$localFileChecksum" = "$repoFileChecksum" ]; then
|
||||||
printf "%s[AVAILABLE]%s\n" "$yellow" "$norm"
|
printf "%s[AVAILABLE]%s " "$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\n" "$err" "$norm"
|
printf "%s[ERROR]%s\n" "$err" "$norm"
|
||||||
downloadFailed=$((downloadFailed+1))
|
downloadFailed=$((downloadFailed+1))
|
||||||
else
|
else
|
||||||
printf "%s[OK] %s" "$ok" "$norm"
|
printf "%s[DOWNLOADED] %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,7 +155,18 @@ 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"
|
||||||
printf "\tDownloads: %s successful, %s%s failed%s\n" "$downloadSuccess" "$err" "$downloadFailed" "$norm"
|
if [ "$updatesAvailable" -gt '0' ]; then
|
||||||
printf "\tUpdates: %s applied, %s%s failed%s\n" "$updateSuccess" "$err" "$updateFailed" "$norm"
|
if [ "$downloadFailed" -gt '0' ]; then
|
||||||
|
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
|
||||||
|
|
||||||
exit 0
|
#EOF
|
@ -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
|
||||||
2d5ccdfa11943edf5f29cd65bc5d597f47bb702f8f85924b14a55042d13bb3d9 ab-openldap-update.sh
|
ed4091788e258c545a13c061459e4d206f8edd98b79abdcc8052aad43acb405b ab-openldap-update.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user