如何用脚本判断当前的系统是用lilo启动还是用grub启动的
如何用脚本判断当前的系统是用lilo启动还是用grub启动的? 可能看看有没有lilo.conf没有的话可能是因为使用grub来启动
其他的 不清楚
那 看看mbr代码可能不同 檢查是用那一個config 檔算是一種方法。
#! /bin/bash
if [ -e /etc/grub.conf ]; then
echo "grub is the boot manager."
elif [ -e /etc/lilo.conf ] ; then
echo "lilo is the boot manager."
else
echo "others."
fi 檢查是用那一個config 檔算是一種方法。
#! /bin/bash
if [ -e /etc/grub.conf ]; then
echo "grub is the boot manager."
elif [ -e /etc/lilo.conf ] ; then
echo "lilo is the boot manager."
else
echo "others."
fi
兄弟,不同版本不一样。据我所知的linux版本都将grub.conf放在/boot/grub/下面,甚至根本就没有grub.conf这个文件 在linuxsir.org上有人回答了, 可以.
if dd if=/dev/hda bs=446 count=1 | strings | grep -q GRUB; then
echo "Your bootloader is GRUB"
elif dd if=/dev/hda bs=446 count=1 | strings | grep LILO; then
echo "Your bootloader is LILO"
else
echo "Unknown bootloader"
fi 在linuxsir.org上有人回答了, 可以.
if dd if=/dev/hda bs=446 count=1 | strings | grep -q GRUB; then
echo "Your bootloader is GRUB"
elif dd if=/dev/hda bs=446 count=1 | strings | grep LILO; then
echo "Your bootloader is LILO"
else
echo "Unknown bootloader"
fi
哈哈 我还猜对拉 :mrgreen:
页:
[1]