Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1298772
  • 博文数量: 548
  • 博客积分: 7597
  • 博客等级: 少将
  • 技术积分: 4224
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-15 13:21
个人简介

嵌入式软件工程师&&太极拳

文章分类

全部博文(548)

文章存档

2014年(10)

2013年(76)

2012年(175)

2011年(287)

分类: LINUX

2011-03-04 22:25:19

#!/bin/bash

function isocopy()
{
 hdid=`df -h   | grep  /$ | awk '{print $1}' | awk -F"sda" '{print $2}'`
 size=`df --block-size=102400000 | grep /$ | awk '{print $4}'`
 if [ $size -lt 18 ]
 then
  echo "You have not enough space in / partition. Reference installation notic.";
  exit;
 else
  echo "Trying download, please wait for few minutes"
  mkdir /isoroot
  wget -P/isoroot   &> /dev/null
  wget -P/isoroot &> /dev/null
  wget -P/isoroot &> /dev/null

  if [ ! -f "/isoroot/0.91.iso" ]
  then
   echo "Download error check your network.";
   exit
  else
   filesize=`ls -l /isoroot/0.91.iso | awk '{print $5}'`
   if [ $filesize -gt 695578600 ]
   then
    echo "download complete"
   else
    echo "download error"
    exit
   fi
  fi
   let hdid--
  echo "title isoboot" >> /boot/grub/grub.conf
  echo "  root (hd0,$hdid)" >>/boot/grub/grub.conf
  echo ' kernel /isoroot/uvmlinuz boot=casper iso-scan/filename=/isoroot/0.91.iso quiet splash ro locale=zh_CN.UTF-8' >> /boot/grub/grub.conf
  echo " initrd /isoroot/uinitrd.gz" >> /boot/grub/grub.conf
  sed -i s/hiddenmenu// /boot/grub/grub.conf
  grub-install --recheck /dev/sda  &> /dev/null
  echo "Install complete please reboot your computer and try"

 fi

}


echo "###########################################################"
echo "#                                                         #"
echo "#                 Installation notic                      #"
echo "#                                                         #"
echo "#   This program would download iso image automatic.      #"
echo "#   Image would place in /isoroot directory.              #"
echo "#   Your  / partition must be more than 2G free space.    #"
echo "#   Otherwise installtion would break off  automatic.     #"
echo "#   After installation, reboot your computer.             #"
echo "#   Choose isoboot boot entry, enjoy learning online.     #"
echo "#                                                         #"
echo "#                                                         #"
echo "#                                                         #"
echo "#                                                         #"
echo "#               video server ip is: 10.1.0.1              #"
echo "#             video server user is: vtest                 #"
echo "#         video server password is: 123456                #"
echo "#                                                         #"
echo "#                                                         #"
echo "#                          Remind by: Terry Tsang         #"
echo "#                                                         #"
echo "###########################################################"
echo
echo  -n "what is video server ip?  [input 10.1.0.1]   "
read answer
if [ "$answer" !=  "10.1.0.1" ]
then
 echo "Reference installation notic."
 exit
fi

echo  -n "what is video login username?  [input vtest]   "
read answer
if [ "$answer" !=  "vtest" ]
then
 echo "Reference installation notic."
 exit
fi

echo  -n "what is video login password?  [input 123456]  "
read answer
if [ "$answer" !=  "123456" ]
then
 echo "Reference installation notic."
 exit
fi

isocopy

 

阅读(732) | 评论(0) | 转发(0) |
0

上一篇:c测试题

下一篇:利用audio播放音乐的程序

给主人留下些什么吧!~~