Ceph: Fix the Debian version comparison

This commit is contained in:
Jeremy Gardais 2021-03-24 06:38:36 +01:00
parent ba359c4f75
commit ea792f4d43
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 3 additions and 2 deletions

View File

@ -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