fixed the empty dpkg.log condition
This commit is contained in:
Родитель
06046831b9
Коммит
7ce7dcce3a
|
@ -13,6 +13,12 @@ recover_suse() {
|
||||||
}
|
}
|
||||||
|
|
||||||
recover_ubuntu() {
|
recover_ubuntu() {
|
||||||
|
if [[ ! -e /var/log/dpkg.log ]]; then
|
||||||
|
Log-Error "dpkg.log does not exist. This is a vanilla system with no previous kernel version installed. Nothing to do."
|
||||||
|
Log-Error "If you are sure there exists more than one kernel please do a manual recover "
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
kernel_version=$( zgrep linux-image /var/log/dpkg.log* | grep installed | cut -d' ' -f5 | cut -d':' -f1 | sed -e 's/linux-image-//' | grep ^[1-9] | sort -V | tail -n 1)
|
kernel_version=$( zgrep linux-image /var/log/dpkg.log* | grep installed | cut -d' ' -f5 | cut -d':' -f1 | sed -e 's/linux-image-//' | grep ^[1-9] | sort -V | tail -n 1)
|
||||||
# This is needed on Debian only
|
# This is needed on Debian only
|
||||||
if [[ -e /boot/initrd.img-${kernel_version} ]]; then
|
if [[ -e /boot/initrd.img-${kernel_version} ]]; then
|
||||||
|
|
Загрузка…
Ссылка в новой задаче