cheng029 发表于 2012-8-8 08:56:10

自动安装varnish shell脚本

#!/bin/sh
##编写目的:自动安装Varnish
##编写时间:2011年07月19日14:40:06
###定义变量##############
srcpath=/root/work
apppath=/usr/local
cat << EOF
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++Welcome to use Linux installed a key Varnish shells scripts ++++++++
+++++++++++++++++++++*************************+++++++++++++++++++++++
EOF
sleep 2
if
[ $UID -ne 0 ];then
echo “This script must use administrator or root user ,please exit …….”
sleep 2
exit 1
fi
Download ()
{
cd $srcpath && wget http://repo.varnish-cache.org/source/varnish-3.0.0.tar.gz #######如果是多个文件要get,那么可以这么写:wget http://repo.varnish-cache.org/source/{1.ta.gz,2.tar.gz}
echo “THIS IS STARTING SHELL MAKE INSTALL SHELL ,PLEASE WAITING ………………………..”
sleep 2s
if [ $? -eq 0 ];then
echo -n “DownLoad Linux source packages End ,Please Waiting Install………………”
else
echo -n “Download Linux source packages Failed ,Please Check………………”
fi
}
YUM_install ()
{
yum install -y automake autoconf libtool ncurses-devel libxslt groff pcre-devel pkgconfig
echo "starting install +++++++++++++++ Please wariting!"
sleep 2s
if [ $? -eq 0 ];then
echo -n "YUM install OK"
else
echo -n "YUM install failed please checking"
fi
}
Varnish30_install ()
{
cd $srcpath && tar -xzvf varnish-3.0.0.tar.gz && cd varnish-3.0.0 && ./configure --prefix=$apppath/varnishi-0.3.0 && make all &&make install
if
[ $? -eq 0 ];then
echo “This pvarnish.3.0 make install end ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++”
else
echo “Varnish install failed ,please check install shell or system gcc configuration ,exiting ……….”
sleep 2s
exit 1
fi
}
EXIT ()
{
echo “Now not Install ,Please exit …………………..”
exit 0
}
PS3="Please Select Install Linux Packages:"
select option in Download Varnish30_install EXIT
do
$option
done
以下上面select 的另外一种写法。
#case $i in
#Download)
#Download
#;;
#YUM_install)
#YUM_install
#;;
#Varnish30_install)
#Varnish30_install
#;;
#*)
#echo "$0 Download |YUM_install |Varnish30_install"
#;;
#esac

darkpoon 发表于 2013-3-13 16:37:23

支持一下:lol

zhaolu 发表于 2013-5-15 19:51:56

有竞争才有进步嘛

fairyguo 发表于 2013-5-17 05:29:17

所有刻骨铭心的爱都灵魂游离于床上的瞬间!

Izhuceul 发表于 2013-5-18 12:13:21

如果恐龙是人,那人是什么?

TOUVE 发表于 2013-5-19 12:36:29

男人与女人,终究也只是欲望的动物吧!真的可以因为爱而结合吗?对不起,我也不知道。。

hhajhh 发表于 2013-5-21 03:18:45

学海无涯,回头是岸!
页: [1]
查看完整版本: 自动安装varnish shell脚本