当前位置导航:炫浪网>>网络学院>>操作系统>>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 [email protected]
  #
  # 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 ""
相关内容
赞助商链接