intersafe前期安装的判断脚本(练习脚本)

这是我这两天写的一个关于intersafe前期安装的一个脚本,测试成功。本想结合intersafe的安装脚本来写完全,但是由于intersafe目前仅支持 RedhatAS4,在Redhat5上面一安装就会报错。碍于目前linux 还不是很熟,目前练习写一些看一些简单的脚本。日后学会了更多的shell语句,不断

#!/bin/bash
# This program is used for install intersafe
# made by chenbaocheng
# ctime :2010/8/30

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

echo "Hello,This is program will help you install intersafe quickly"

echo "##############################################"
echo "###                                                                                           ###"
echo "###This is ryoyo intersafe install program!                      ###"
echo "###Version: 4                                                                        ###"
echo "###Creat time :2010/8/31                                                   ###"
echo "###made by chen                                                                ###"
echo "###                                                                                          ###"
echo "##############################################"

#cp file
#cd /media/REBOOT
cd /home/001
test -e /root/intersafe && echo "The directory already exists " ||
mkdir /root/intersafe && echo "this directory is created"
cp -r * /root/intersafe  && echo "Have to copy the contents of the CD to /root /intersafe directory"

#check squid
search='rpm -qa | grep squid && echo "1" || echo "0" '
if [ "$search" = "0" ]; then
        echo "OK,squid is installed "
else
yum install squid
fi

#config  squid
test -e /home/cache || mkdir /home/cache
chown squid:squid /home/cache
test -f /etc/squid/squid.conf ||  mv /etc/squid/squid.conf /etc/squid/squid.confbk

cp -f /root/intersafe/2.squid.conf /etc/squid/squid.conf

#check squid service
sqi='service squid status'
if [ "$sqi" = "squid is stopped" ]; then
        echo "squid is stopped"
        service squid start
else
        service squid status
fi

#check lib
rpm -qa | grep compat-libstdc++  || yum install compat-libstdc++
rpm -p" |awk '{print$4}'`qa | grep libstdc++
 

你可能感兴趣的:(shell,职场,练习,休闲,intersafe)