Skip to content

Commit e8e0b4a

Browse files
author
Dominik
authored
Merge pull request #8 from DomiStyle/lib-load
Load libraries correctly
2 parents 4ed6db9 + 4e85c40 commit e8e0b4a

File tree

3 files changed

+43
-36
lines changed

3 files changed

+43
-36
lines changed

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
FROM jlesage/baseimage-gui:alpine-3.7
1+
FROM jlesage/baseimage-gui:ubuntu-16.04
22

33
ENV APP_NAME="iDRAC 6" \
44
IDRAC_PORT=443
55

6-
RUN apk add --no-cache openjdk7-jre
6+
RUN apt-get update && \
7+
apt-get install -y software-properties-common wget && \
8+
add-apt-repository ppa:openjdk-r/ppa && \
9+
apt-get update && \
10+
apt-get install -y openjdk-7-jdk && \
11+
rm -rf /var/lib/apt/lists/*
712

813
RUN mkdir /app && \
914
chown ${USER_ID}:${GROUP_ID} /app

docker-compose.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

startapp.sh

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,96 @@
11
#!/bin/sh
22

3+
GREEN='\033[0;32m'
34
RED='\033[0;31m'
45
NC='\033[0m'
56

67
echo "Starting"
78

89
if [ -z "${IDRAC_HOST}" ]; then
9-
echo -e "${RED}Please set a proper idrac host with IDRAC_HOST${NC}"
10+
echo "${RED}Please set a proper idrac host with IDRAC_HOST${NC}"
1011
sleep 2
1112
exit 1
1213
fi
1314

1415
if [ -z "${IDRAC_PORT}" ]; then
15-
echo -e "${RED}Please set a proper idrac port with IDRAC_PORT${NC}"
16+
echo "${RED}Please set a proper idrac port with IDRAC_PORT${NC}"
1617
sleep 2
1718
exit 1
1819
fi
1920

2021
if [ -z "${IDRAC_USER}" ]; then
21-
echo -e "${RED}Please set a proper idrac user with IDRAC_USER${NC}"
22+
echo "${RED}Please set a proper idrac user with IDRAC_USER${NC}"
2223
sleep 2
2324
exit 1
2425
fi
2526

2627
if [ -z "${IDRAC_PASSWORD}" ]; then
27-
echo -e "${RED}Please set a proper idrac password with IDRAC_PASSWORD${NC}"
28+
echo "${RED}Please set a proper idrac password with IDRAC_PASSWORD${NC}"
2829
sleep 2
2930
exit 1
3031
fi
3132

3233
echo "Environment ok"
3334

34-
echo "Creating library folder"
35-
3635
cd /app
37-
mkdir lib
3836

39-
echo "Downloading required files"
37+
if [ ! -d "lib" ]; then
38+
echo "Creating library folder"
39+
mkdir lib
40+
fi
4041

4142
if [ ! -f avctKVM.jar ]; then
43+
echo "Downloading avctKVM"
44+
4245
wget https://${IDRAC_HOST}:${IDRAC_PORT}/software/avctKVM.jar --no-check-certificate
4346

4447
if [ ! $? -eq 0 ]; then
45-
echo -e "${RED}Failed to download avctKVM.jar, please check your settings${NC}"
48+
echo "${RED}Failed to download avctKVM.jar, please check your settings${NC}"
4649
sleep 2
4750
exit 2
4851
fi
4952
fi
5053

5154
if [ ! -f lib/avctKVMIOLinux64.jar ]; then
55+
echo "Downloading avctKVMIOLinux64"
56+
5257
wget -O lib/avctKVMIOLinux64.jar https://${IDRAC_HOST}:${IDRAC_PORT}/software/avctKVMIOLinux64.jar --no-check-certificate
5358

5459
if [ ! $? -eq 0 ]; then
55-
echo -e "${RED}Failed to download avctKVMIOLinux64.jar, please check your settings${NC}"
60+
echo "${RED}Failed to download avctKVMIOLinux64.jar, please check your settings${NC}"
5661
sleep 2
5762
exit 2
5863
fi
5964
fi
6065

6166
if [ ! -f lib/avctVMLinux64.jar ]; then
67+
echo "Downloading avctVMLinux64"
68+
6269
wget -O lib/avctVMLinux64.jar https://${IDRAC_HOST}:${IDRAC_PORT}/software/avctVMLinux64.jar --no-check-certificate
6370

6471
if [ ! $? -eq 0 ]; then
65-
echo -e "${RED}Failed to download avctVMLinux64.jar, please check your settings${NC}"
72+
echo "${RED}Failed to download avctVMLinux64.jar, please check your settings${NC}"
6673
sleep 2
6774
exit 2
6875
fi
6976
fi
7077

78+
cd lib
79+
80+
if [ ! -f lib/avctKVMIOLinux64.so ]; then
81+
echo "Extracting avctKVMIOLinux64"
82+
83+
jar -xf avctKVMIOLinux64.jar
84+
fi
85+
86+
if [ ! -f lib/avctVMLinux64.so ]; then
87+
echo "Extracting avctVMLinux64"
88+
89+
jar -xf avctVMLinux64.jar
90+
fi
91+
92+
cd /app
93+
94+
echo "${GREEN}Initialization complete, starting virtual console${NC}"
95+
7196
exec java -cp avctKVM.jar -Djava.library.path="./lib" com.avocent.idrac.kvm.Main ip=${IDRAC_HOST} kmport=5900 vport=5900 user=${IDRAC_USER} passwd=${IDRAC_PASSWORD} apcp=1 version=2 vmprivilege=true "helpurl=https://${IDRAC_HOST}:443/help/contents.html"

0 commit comments

Comments
 (0)