-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroot-setup.sh
executable file
·118 lines (95 loc) · 3.22 KB
/
root-setup.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
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/sh
# supply a valid subscription manager pool id to access the following channels:
#
# rhel-7-server-rpms
# rhel-7-server-optional-rpms
# rhel-7-server-supplementary-rpms
# rhel-7-server-extras-rpms
# Insert your subscription manager pool id here, if known. Otherwise,
# this script will try to dynamically determine the pool id.
SM_POOL_ID=
function usage {
echo
echo "usage: sudo $0"
echo
exit 1
}
# must be root to run this script
if [ "`whoami`" != "root" ]
then
usage
fi
# register with Red Hat subscription manager
echo "Please provide your RHN credentials"
subscription-manager register
# if no SM_POOL_ID defined, attempt to find the Red Hat employee
# "kitchen sink" SKU (of course, this only works for RH employees)
if [ "x${SM_POOL_ID}" = "x" ]
then
SM_POOL_ID=`subscription-manager list --available | \
grep 'Subscription Name:\|Pool ID:\|System Type' | \
grep -B2 'Virtual' | \
grep -A1 'Employee SKU' | \
grep 'Pool ID:' | awk '{print $3}'`
# exit if none found
if [ "x${SM_POOL_ID}" = "x" ]
then
echo "No subcription manager pool id found. Exiting"
exit 1
fi
fi
# attach the desired pool id
subscription-manager attach --pool="$SM_POOL_ID"
# enable the required repos
subscription-manager repos --disable="*"
subscription-manager repos --enable=rhel-7-server-rpms \
--enable=rhel-7-server-optional-rpms \
--enable=rhel-7-server-supplementary-rpms \
--enable=rhel-7-server-extras-rpms
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
# install EPEL to get the extra packages for guacamole, guacd,
# libguac-client-vnc, and openbox
yum -y localinstall resources/epel-release-latest-7.noarch.rpm
# speed up updates
yum -y install deltarpm
# update the install
yum -y update
yum clean all
# install the packages
yum -y install tigervnc-server gtk2 java-1.8.0-openjdk-devel \
liberation-fonts-common liberation-sans-fonts
yum -y install libguac-client-vnc guacd openbox guacamole
# install wmctrl since not in EPEL or standard channels
WMCTRL_RPM=wmctrl-1.07-15.el7.nux.x86_64.rpm
curl ftp://ftp.pbone.net/mirror/li.nux.ro/download/nux/dextop/el7/x86_64/$WMCTRL_RPM \
-o resources/$WMCTRL_RPM
yum -y localinstall resources/$WMCTRL_RPM
# make sure that tomcat and guacd do not auto-start at boot
systemctl disable tomcat
systemctl disable guacd
# update the user-mapping.xml file for guacamole
cp resources/user-mapping.xml /etc/guacamole
# set up JBDS
rm -fr /usr/share/jbdevstudio
java -jar resources/jboss-devstudio-8.1.0.GA-installer-standalone.jar \
resources/InstallConfigRecord.xml
chcon -R system_u:object_r:usr_t:s0 /usr/share/jbdevstudio
# enable access through firewall
firewall-cmd --permanent --zone=public --add-port=8080/tcp
firewall-cmd --reload
# remove JBDS native libraries and checksum files that are already
# installed in system lib directories to avoid conflicts
for ext in so chk
do
for jbdslib in `find /usr/share/jbdevstudio -name "*.$ext"`
do
jbdslib_basename=`basename $jbdslib`
for syslibdir in /lib64 /usr/lib64
do
for dummy in `find $syslibdir -name $jbdslib_basename`
do
[ -f $jbdslib ] && rm -f $jbdslib
done
done
done
done