forked from trifork/sdm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·59 lines (42 loc) · 1.25 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
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
set -u
set -e
for confFile in *_config.cfg
do
echo "Reading properties from '${confFile}'"
source "${confFile}"
done
echo "Stopping JBoss server instance before deploying"
jboss_pid=$(/pack/jdk/bin/jps -l | grep jboss | cut -d " " -f 1) || true
if [ -n "${jboss_pid}" ]; then
echo "Stopping jboss"
/etc/init.d/jboss stop || true
jboss_pid_2=$(/pack/jdk/bin/jps -l | grep jboss | cut -d " " -f 1) || true
if [ -n "${jboss_pid_2}" ]; then
echo "Shutdown of jboss failed, killing process"
kill -9 ${jboss_pid_2}
fi
fi
echo "Clearing JBoss log directory: '${jboss_log_dir}'"
rm -f ${jboss_log_dir}/*
for file in *_*_install.sh
do
# do something on "$file"
echo "Executing file: ${file}"
source "${file}"
done
echo "Copying properties to jboss conf folder"
find conf/ -name "[^\.]*.properties" -exec cp {} ${jboss_conf_dir}/ \;
# Recreate the original properties so the installer can be run again
for file in conf/*.properties.orig
do
# do something on "$file"
new_file_name=${file%.orig}
mv -f "${file}" "${new_file_name}"
done
echo "Copying war files to ${jboss_deploy_dir}"
cp deploy/* ${jboss_deploy_dir}/
echo "Starting jboss"
/etc/init.d/jboss start
echo
echo "Done deploying - check the jboss log files in ${jboss_log_dir}"