小技巧:让你的Debia每次开机画面都不一样

王朝other·作者佚名  2008-05-19
窄屏简体版  字體: |||超大  

下面的代码可以让你使用lilo开机的debian机器每次的开机画面都不一样,系统每次开机自动切换一个画面。

#!/bin/bash

#

# bs_switch This script can collect all the bmp files in the directory

# /usr/share/lilo/contrib and switch the bs_wwitch in sequence

# automatically under Debian Linux(Sarge version).

# It's written by Simon Zhan from Minqing County, China.

#

# Version @(#)bs_switch 0.8 11-May-2004 simonzhan@21cn.com

#

# notes: bs.lst contain all the files name in the

# /usr/share/lilo/contrib, and will delete one entry every

# rebooting the system.

# FILENAME is the file name which will replace the previous bmp.

#

# Usage: Copy this script into /etc/init.d, and make a symbolic link into

# /etc/rcS.d such as follow(notice the file's permission):

# ln -s /etc/init.d/bs_switch /etc/rcS.d/S55bs_switch

# and Enjoy!

cd /usr/share/lilo/contrib

while true

do

if [ ! -f /usr/share/lilo/contrib/bs.lst ];then

echo ""

echo "**************************************"

echo "* bs.lst not exist!, now creating... *"

echo "**************************************"

echo ""

sleep 3

ls /usr/share/lilo/contrib/*.bmp /tmp/tmp.file

sed '/debian1.bmp/d' /tmp/tmp.file /usr/share/lilo/contrib/bs.lst

fi

FILENAME=`sed -n '1p' /usr/share/lilo/contrib/bs.lst`

sed 1d /usr/share/lilo/contrib/bs.lst /tmp/tmp.ls

if [ ! -s /tmp/tmp.ls ];then

echo ""

echo "**********************************************"

echo "* size of the bs.lst is zero, now delete it. *"

echo "**********************************************"

echo ""

sleep 3

rm /usr/share/lilo/contrib/bs.lst

else

mv /tmp/tmp.ls /usr/share/lilo/contrib/bs.lst

fi

if [ -f $FILENAME ];then

echo ""

echo "*******************"

echo "* Ok, I found it! *"

echo "*******************"

echo ""

sleep 3

break

fi

echo ""

echo "*****************************************************************"

echo "* OOPS!, I can't find the bmp file, I have to go to the next... *"

echo "*****************************************************************"

echo ""

sleep 3

done

cp $FILENAME debian1.bmp

lilo /dev/null 2&1

echo ""

echo "*********************************"

echo "* Bootscreen has been switched! *"

echo "*********************************"

echo ""

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航