-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·48 lines (39 loc) · 1.51 KB
/
install.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
#!/usr/bin/env bash
function waiting_for_jboss {
while [[ $(sudo netstat -ltnp | grep 9990 | wc -l) -lt 1 ]] ; do sleep 1s ; done
}
waiting_for_jboss
if [[ "${JBOSS_EAP_PATCH}" != "7.3.0" ]] ; then
mkdir -p ./patches
wget -q -i "${PATCHES_BASE_URL}/index.txt" -P ./patches/ || echo "no patches found."
for PATCH_FILENAME in $(ls ./patches/*.zip) ; do
echo "Applying $(basename ./patches/${PATCH_FILENAME}) file..."
INSTRUCTIONS_FILE="${PATCH_FILENAME}.instructions"
##modification problem solving:
#if [[ ${PATCH_FILENAME} == *-7.3.0-patch.zip ]] ; then
# echo "connect
# patch apply ${PATCH_FILENAME} --override=bin/standalone.conf,bin/standalone.conf.bat
# shutdown --restart=true" > ${INSTRUCTIONS_FILE}
#else
echo "connect
patch apply ${PATCH_FILENAME}
shutdown --restart=true" > ${INSTRUCTIONS_FILE}
#fi
jboss-cli.sh --file=${INSTRUCTIONS_FILE}
rm -rf ${INSTRUCTIONS_FILE} ${PATCH_FILENAME}
waiting_for_jboss
done
fi
if [[ -z ${KEEP_HISTORY} ]] || [[ ! ${KEEP_HISTORY} =~ ^(keep|yes|true)$ ]] ; then
echo "Cleanup history..."
jboss-cli.sh --commands="connect","/core-service=patching:ageout-history"
fi
echo "Shutdown JBoss..."
jboss-cli.sh --commands="connect","shutdown --restart=false"
if [[ -z ${KEEP_HISTORY} ]] || [[ ! ${KEEP_HISTORY} =~ ^(keep|yes|true)$ ]] ; then
echo "Cleanup tmp, data, logs..."
for FOLDER in "tmp" "data" "log" ; do
sudo rm -rf ${JBOSS_HOME}/standalone/${FOLDER}
done
fi
echo "Done."