]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
51-dracut-rescue-postinst.sh: add extra checks
authorHarald Hoyer <harald@redhat.com>
Tue, 19 Mar 2013 15:56:56 +0000 (16:56 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 19 Mar 2013 15:56:56 +0000 (16:56 +0100)
51-dracut-rescue-postinst.sh

index 21208a441d6c30c325805b387a360460d9c67f45..d20649662318f5e84f5ddc42d7105c7268c447d1 100755 (executable)
@@ -10,6 +10,9 @@ KERNEL_IMAGE="$2"
 [[ -f /etc/os-release ]] && . /etc/os-release
 [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
 
+[[ $MACHINE_ID ]] || exit 1
+[[ -f $KERNEL_IMAGE ]] || exit 1
+
 INITRDFILE="/boot/initramfs-${MACHINE_ID}-rescue.img"
 [[ -f $INITRDFILE ]] && exit 0