当前位置:操作系统 > Unix/Linux >>

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

下面的代码可以让你使用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 ""

  

上一个:配置OracleDesigner的Repository
下一个:Linux知识宝库:Kylix经典十大难题解决方法

更多Unix/Linux疑问解答:
路由原理介绍
子网掩码快速算法
改变网络接口的速度和协商方式的工具miitool和ethtool
Loopback口的作用汇总
OSPF的童话
增强的ACL修改功能
三层交换机和路由器的比较
用三层交换机组建校园网
4到7层交换识别内容
SPARC中如何安装Linux系统(2)
SPARC中如何安装Linux系统(1)
用Swatch做Linux日志分析
实战多种Linux操作系统共存
浅析Linux系统帐户的管理和审计
Linux2.6对新型CPU的支持(2)
电脑通通透
玩转网络
IE/注册表
DOS/Win9x
Windows Xp
Windows 2000
Windows 2003
Windows Vista
Windows 2008
Windows7
Unix/Linux
苹果机Mac OS
windows8
安卓/Android
Windows10
如果你遇到操作系统难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,