From b004b9270ec6eb3d810667c0a0eae07957b49062 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 22 Aug 2016 11:10:43 +0200 Subject: [PATCH] boot_loader --- etc/profile.d/functions | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/etc/profile.d/functions b/etc/profile.d/functions index b7c380de..4ec9d6f4 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -543,3 +543,15 @@ urldecode() { local url_encoded="${1//+/ }" printf '%b\n' "${url_encoded//%/\\x}" } + +boot_loader() { + local mbr=`dd if=/dev/sda bs=446 count=1 2> /dev/null| strings -a` + + case "$mbr" in + *GRUB*) echo "GRUB" ;; + *LILO*) echo "LILO" ;; + *) return 1 ;; + esac + + return 0 +} -- 2.47.3