Add support for a custom VNC port

This commit is contained in:
nochkin 2024-05-03 15:33:57 -04:00
parent c4d2330562
commit 2c35a02a95
2 changed files with 14 additions and 2 deletions

View File

@ -2,6 +2,7 @@ FROM jlesage/baseimage-gui:debian-11
ENV APP_NAME="iDRAC 6" \
IDRAC_PORT=443 \
IDRAC_VNC_PORT=5900 \
DISPLAY_WIDTH=801 \
DISPLAY_HEIGHT=621

View File

@ -26,6 +26,11 @@ if [ -f "/run/secrets/idrac_password" ]; then
IDRAC_PASSWORD="$(cat /run/secrets/idrac_password)"
fi
if [ -f "/run/secrets/idrac_vnc_port" ]; then
echo "Using Docker secret for IDRAC_VNC_PORT"
IDRAC_VNC_PORT="$(cat /run/secrets/idrac_vnc_port)"
fi
if [ -z "${IDRAC_HOST}" ]; then
echo "${RED}Please set a proper idrac host with IDRAC_HOST${NC}"
sleep 2
@ -50,6 +55,12 @@ if [ -z "${IDRAC_PASSWORD}" ]; then
exit 1
fi
if [ -z "${IDRAC_VNC_PORT}" ]; then
echo "${RED}Please set a proper idrac VNC port with IDRAC_VNC_PORT${NC}"
sleep 2
exit 1
fi
echo "Environment ok"
cd /app
@ -118,7 +129,7 @@ if [ -n "$IDRAC_KEYCODE_HACK" ]; then
export LD_PRELOAD=/keycode-hack.so
fi
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" &
exec java -cp avctKVM.jar -Djava.library.path="./lib" com.avocent.idrac.kvm.Main ip=${IDRAC_HOST} kmport=${IDRAC_VNC_PORT} vport=${IDRAC_VNC_PORT} user=${IDRAC_USER} passwd=${IDRAC_PASSWORD} apcp=1 version=2 vmprivilege=true "helpurl=https://${IDRAC_HOST}:${IDRAC_PORT}/help/contents.html" &
# If an iso exists at the specified location, mount it
[ -f "/vmedia/$VIRTUAL_ISO" ] && /mountiso.sh