From c438d9a8848c4ff08d1a89c070f1ab177b62a625 Mon Sep 17 00:00:00 2001 From: Justin Travis Date: Sun, 24 Jul 2022 22:52:49 -0400 Subject: [PATCH] KASM-2969 Remove custom_startup.sh --- dockerfile-kasm-unityhub | 4 - src/ubuntu/install/unityhub/custom_startup.sh | 84 ------------------- 2 files changed, 88 deletions(-) delete mode 100644 src/ubuntu/install/unityhub/custom_startup.sh diff --git a/dockerfile-kasm-unityhub b/dockerfile-kasm-unityhub index 87c92f7..611b8bd 100644 --- a/dockerfile-kasm-unityhub +++ b/dockerfile-kasm-unityhub @@ -24,10 +24,6 @@ RUN bash $INST_SCRIPTS/chrome/install_chrome.sh && rm -rf $INST_SCRIPTS/chrome/ COPY ./src/ubuntu/install/unityhub $INST_SCRIPTS/unityhub/ RUN bash $INST_SCRIPTS/unityhub/install_unityhub.sh && rm -rf $INST_SCRIPTS/unityhub/ -COPY ./src/ubuntu/install/unityhub/custom_startup.sh $STARTUPDIR/custom_startup.sh -RUN chmod +x $STARTUPDIR/custom_startup.sh -RUN chmod 755 $STARTUPDIR/custom_startup.sh - ######### End Customizations ########### RUN chown 1000:0 $HOME diff --git a/src/ubuntu/install/unityhub/custom_startup.sh b/src/ubuntu/install/unityhub/custom_startup.sh deleted file mode 100644 index 15a8d0c..0000000 --- a/src/ubuntu/install/unityhub/custom_startup.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash -set -ex -START_COMMAND="/opt/unityhub/unityhub" -PGREP="unityhub-bin" -export MAXIMIZE="false" -export MAXIMIZE_NAME="Unity" -MAXIMIZE_SCRIPT=$STARTUPDIR/maximize_window.sh -DEFAULT_ARGS=" --no-sandbox" -ARGS=${APP_ARGS:-$DEFAULT_ARGS} - -options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit -eval set -- "$options" - -while [[ $1 != -- ]]; do - case $1 in - -g|--go) GO='true'; shift 1;; - -a|--assign) ASSIGN='true'; shift 1;; - -u|--url) OPT_URL=$2; shift 2;; - *) echo "bad option: $1" >&2; exit 1;; - esac -done -shift - -# Process non-option arguments. -for arg; do - echo "arg! $arg" -done - -FORCE=$2 - -kasm_exec() { - if [ -n "$OPT_URL" ] ; then - URL=$OPT_URL - elif [ -n "$1" ] ; then - URL=$1 - fi - - # Since we are execing into a container that already has the browser running from startup, - # when we don't have a URL to open we want to do nothing. Otherwise a second browser instance would open. - if [ -n "$URL" ] ; then - /usr/bin/filter_ready - /usr/bin/desktop_ready - bash ${MAXIMIZE_SCRIPT} & - $START_COMMAND $ARGS $OPT_URL - else - echo "No URL specified for exec command. Doing nothing." - fi -} - -kasm_startup() { - if [ -n "$KASM_URL" ] ; then - URL=$KASM_URL - elif [ -z "$URL" ] ; then - URL=$LAUNCH_URL - fi - - if [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ; then - - echo "Entering process startup loop" - set +x - while true - do - if ! pgrep -x $PGREP > /dev/null - then - /usr/bin/filter_ready - /usr/bin/desktop_ready - set +e - bash ${MAXIMIZE_SCRIPT} & - $START_COMMAND $ARGS $URL - set -e - fi - sleep 1 - done - set -x - - fi - -} - -if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then - kasm_exec -else - kasm_startup -fi