此文是静默一键安装was7脚本,包含was,IHS,Plug补丁升级
#!/bin/sh
# this scripts should be run as root,it can turn was123 user
#created by lj
die () {
echo "ERROR: $1. Aborting!"
exit 1
}
#centos6.5安装IHS前
echo "centos6.5安装IHS前,jdk1.6要装下,如果有库没有引用到,将库做下剪切操作,重装jdk"
yum install glibc.i686 -y
yum install libgcc.i686 -y
#检查系统版本
version5=`cat /etc/redhat-release | awk '{print $7}'`
version6=`cat /etc/redhat-release | awk '{print $3}'`
创建was123用户
echo "创建was123 普通用户"
USER_COUNT=`cat /etc/passwd | grep '^was123:' -c`
USER_NAME='was123'
if [ $USER_COUNT -ne 1 ]
then
useradd $USER_NAME
echo "密码" | passwd $USER_NAME --stdin
else
echo 'user exits'
fi
#检查/opt目录下是否有相关安装和补丁包,没有提示上传安装包
echo "检查/opt目录下是否有相关安装和补丁包,没有提示上传安装包"
budingbaoshu=`find /opt -maxdepth 1 -mindepth 1 -name "7.0.0*" |wc -l`
anzhuangbaoshu=`find /opt -maxdepth 1 -mindepth 1 -name "C1G3*" |wc -l`
if [ $budingbaoshu -lt 4 ] || [ $anzhuangbaoshu -lt 2 ];then
die "7.0.0.45-WS-UPDI-LinuxAMD64.tar.gz ,7.0.0-WS-PLG-LinuxX64-FP0000045.pak,7.0.0-WS-WAS-LinuxX64-FP0000045.pak,7.0.0-WS-WASSDK-LinuxX64-FP0000045.pak;C1G35ML.tar.gz,C1G36ML.tar.gz is losed someone in /opt "
else
echo "接下来安装was7server和IHS"
fi
chown -R was123.was123 /opt
sleep 5s
#_patchdir=opt
#read -p "Please select the Directory for this was7 patch: [$_patchdir] " patchdir
#if [ !"$patchdir" ]; then
# patchdir=$_patchdir
# echo "Selected default - $patchdir"
#else