-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsilent_deploy.sh
104 lines (83 loc) · 2.63 KB
/
silent_deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
SCRIPT_DIR=`pwd`
ORAINVENTORY_HOME=/opt/oracle/oraInventory
ORACLE_HOME=/opt/oracle/wls12c
# Set the environment variables
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
export PATH=$PATH:$JAVA_HOME/bin
[ -z "$JAVA_HOME" ] && echo -e "JAVA_HOME is not set" && exit 1 || echo -e "JAVA_HOME $JAVA_HOME is set"
echo "JAVA_HOME is set to ************ " $JAVA_HOME
echo "PATH is set to *****************" $PATH
# Check Error
checkError () {
if [ $? -ne 0 ]
then
echo $2
exit
fi
}
if [ -d ${ORAINVENTORY_HOME} ] ; then
echo "Directory exists"
else
echo "Directory does not exist"
echo "Creating the directory"
mkdir -p ${ORAINVENTORY_HOME}
checkError
fi
# Add the contents of the File
locfile()
{
cat << EOF > ${ORAINVENTORY_HOME}/oraInst.loc
#############################
#Oracle Installer Location File Location
inst_group=mwsadmin
inventory_loc=${ORAINVENTORY_HOME}
#####################################
EOF
}
if [ -f ${ORAINVENTORY_HOME}/oraInst.loc ] ;then
echo "File exists"
else
echo "File does not exist"
echo "Creating the File"
touch ${ORAINVENTORY_HOME}/oraInst.loc
checkError
echo "Adding Contents to the loc file"
locfile
fi
Create_Response_file()
{
cat << EOF > ${SCRIPT_DIR}/response_file
########################################
[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0
[GENERIC]
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=$ORACLE_HOME
#Set this variable value to the Installation Type selected. e.g. Fusion Middleware Infrastructure, Fusion Middleware Infrastructure With Examples.
INSTALL_TYPE=Complete with Examples
#Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration
DECLINE_SECURITY_UPDATES=true
########################################
EOF
}
> ${SCRIPT_DIR}/response_file
deployWLS_1212_bin()
{
if [ ! -d $ORACLE_HOME ] && [ -f ${SCRIPT_DIR}/wls_121200.jar ];
then
echo -e "Now Deploying the Weblogic version 12.1.2.0 binary"
# Creating the Response file
echo -e "Creating the Response file for silent install"
Create_Response_file
java -jar ${SCRIPT_DIR}/wls_121200.jar -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -silent -response ${SCRIPT_DIR}/response_file -invPtrLoc ${ORAINVENTORY_HOME}/oraInst.loc
echo -e "Done Deploying the binary for Weblogic version 12.1.2.0"
echo -e ""
else
echo -e "Either the Weblogic binary is not present in the ${SCRIPT_DIR}"
echo -e "or the /opt/oracle/wls12c is occupied"
exit 1
fi
}
deployWLS_1212_bin