aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2019-12-07 22:10:16 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2019-12-07 22:10:16 -0800
commit25c927031601102ff714502cf8b03cb820c0db59 (patch)
tree6d057c6f465c9d25ad76cea5686858c08f426115
parentsnapshots-create: implement new output file for bug #574752 (diff)
downloadmastermirror-scripts-25c927031601102ff714502cf8b03cb820c0db59.tar.gz
mastermirror-scripts-25c927031601102ff714502cf8b03cb820c0db59.tar.bz2
mastermirror-scripts-25c927031601102ff714502cf8b03cb820c0db59.zip
snapshots-creat: more safety around validity checks
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xsnapshots-create.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/snapshots-create.sh b/snapshots-create.sh
index 1721bbd..248612c 100755
--- a/snapshots-create.sh
+++ b/snapshots-create.sh
@@ -193,7 +193,7 @@ write_time_log "END TARBALL $(date -u)"
write_time_log "START SIZE SANITY $(date -u)"
current_size=$(stat -c '%s' "${FILENAME}")
previous_size=$(stat -c '%s' "${previous_snapshot}")
-if [ ${current_size} -lt ${previous_size} ]; then
+if [ -z "$current_size" ] || [ "${current_size}" -lt "${previous_size}" ]; then
size_difference=$(expr ${previous_size} - ${current_size})
difference_ratio=$(expr ${previous_size} / ${size_difference})
if [ ${difference_ratio} -lt 2 ]; then