From ea792f4d439f3386d5ddc8b45ee2cc9891249701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 24 Mar 2021 06:38:36 +0100 Subject: [PATCH] Ceph: Fix the Debian version comparison --- ceph/ceph.backup.deb.files.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ceph/ceph.backup.deb.files.sh b/ceph/ceph.backup.deb.files.sh index ca9ee55..e1b1c14 100755 --- a/ceph/ceph.backup.deb.files.sh +++ b/ceph/ceph.backup.deb.files.sh @@ -34,11 +34,12 @@ if [ "$(command -v ceph)" ]; then cd -- "${CEPH_DEB_PKG_DIR}" > /dev/null || exit 2 ## Download deb files of all ceph related packages installed on the system - [ "${DEBUG}" -eq "0" ] && printf '%b\n' "Download deb files of all ceph related packages installed on the system." ## Use aptitude before Debian Stretch because apt doesn't yet know "download" action - if [ "$(cat /etc/debian_version | cut -c1)" -lt "9" ]; then + if [ "$(cat /etc/debian_version | cut -d"." -f1)" -lt "9" ]; then + [ "${DEBUG}" -eq "0" ] && printf '%b\n' "Download (with aptitude) deb files of all ceph related packages installed on the system." aptitude download -- $(dpkg -l | awk -v pattern="${CEPH_DEB_PKG_PATTERN}" '$0~pattern {print $2"="$3}') || exit 3 else + [ "${DEBUG}" -eq "0" ] && printf '%b\n' "Download (with apt) deb files of all ceph related packages installed on the system." apt download -- $(dpkg -l | awk -v pattern="${CEPH_DEB_PKG_PATTERN}" '$0~pattern {print $2"="$3}') || exit 3 fi