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