From: Nicolas Boisselier Date: Mon, 22 Aug 2016 09:10:43 +0000 (+0200) Subject: boot_loader X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=b004b9270ec6eb3d810667c0a0eae07957b49062;p=nb.git boot_loader --- 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 +}