mirror of
https://github.com/kasmtech/workspaces-images.git
synced 2024-11-07 08:44:07 +01:00
KASM-1550 Better container restarts.
This commit is contained in:
parent
8d5a70eb95
commit
4316cdec01
@ -1,32 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$2
|
||||
if [ -n "$1" ] ; then
|
||||
URL=$1
|
||||
else
|
||||
URL=$LAUNCH_URL
|
||||
fi
|
||||
|
||||
START_COMMAND="brave-browser"
|
||||
PGREP="brave"
|
||||
MAXIMUS="false"
|
||||
DEFAULT_ARGS="--start-maximized"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
if [ -n "$URL" ] && ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x brave > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
brave-browser $ARGS $URL
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,30 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$2
|
||||
if [ -n "$1" ] ; then
|
||||
URL=$1
|
||||
else
|
||||
URL=$LAUNCH_URL
|
||||
fi
|
||||
|
||||
START_COMMAND="google-chrome"
|
||||
PGREP="chrome"
|
||||
MAXIMUS="false"
|
||||
DEFAULT_ARGS="--start-maximized"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
if [ -n "$URL" ] && ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x chrome > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
google-chrome $ARGS $URL
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,30 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$2
|
||||
if [ -n "$1" ] ; then
|
||||
URL=$1
|
||||
else
|
||||
URL=$LAUNCH_URL
|
||||
fi
|
||||
|
||||
START_COMMAND="chromium-browser"
|
||||
PGREP="chromium"
|
||||
MAXIMUS="false"
|
||||
DEFAULT_ARGS="--start-maximized"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
if [ -n "$URL" ] && ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x chromium > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
chromium-browser $ARGS $URL
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
}
|
||||
|
||||
kasm_startup() {
|
||||
if [ -n "$KASM_URL" ] ; then
|
||||
URL=$KASM_URL
|
||||
elif [ -z "$URL" ] ; then
|
||||
URL=$LAUNCH_URL
|
||||
fi
|
||||
|
||||
if [ -n "$URL" ] && ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,30 +1,82 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="/usr/share/discord/Discord"
|
||||
PGREP="Discord"
|
||||
MAXIMUS="false"
|
||||
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
|
||||
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
# 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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x Discord > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
/usr/share/discord/Discord $ARGS &
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL &
|
||||
set -e
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,5 +1,82 @@
|
||||
#!/usr/bin/env bash
|
||||
sleep 3
|
||||
xfce4-terminal -e "/usr/games/chocolate-doom ${APP_ARGS}"
|
||||
set -ex
|
||||
START_COMMAND="/usr/games/chocolate-doom"
|
||||
PGREP="chocolate-doom"
|
||||
DEFAULT_ARGS=""
|
||||
MAXIMUS="false"
|
||||
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
|
||||
$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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
source $STARTUPDIR/generate_container_user
|
||||
$START_COMMAND $ARGS $URL &
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,33 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$2
|
||||
if [ -n "$1" ] ; then
|
||||
URL=$1
|
||||
else
|
||||
URL=$LAUNCH_URL
|
||||
fi
|
||||
|
||||
START_COMMAND="microsoft-edge"
|
||||
PGREP="msedge"
|
||||
MAXIMUS="false"
|
||||
DEFAULT_ARGS="--start-maximized"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit
|
||||
eval set -- "$options"
|
||||
|
||||
if [ -n "$URL" ] && ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
set +e
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
set -e
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x msedge > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
microsoft-edge $ARGS $URL
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
$START_COMMAND $ARGS $URL
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,30 +1,76 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$2
|
||||
if [ -n "$1" ] ; then
|
||||
URL=$1
|
||||
else
|
||||
URL=$LAUNCH_URL
|
||||
fi
|
||||
|
||||
START_COMMAND="firefox"
|
||||
PGREP="firefox"
|
||||
DEFAULT_ARGS="-width ${VNC_RESOLUTION/x*/} -height ${VNC_RESOLUTION/*x/}"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
if [ -n "$URL" ] && ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x firefox > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
firefox $ARGS $URL
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
}
|
||||
|
||||
kasm_startup() {
|
||||
if [ -n "$KASM_URL" ] ; then
|
||||
URL=$KASM_URL
|
||||
elif [ -z "$URL" ] ; then
|
||||
URL=$LAUNCH_URL
|
||||
fi
|
||||
|
||||
if [ -n "$URL" ] && ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -16,7 +16,6 @@ if [ -n "$URL" ] && ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; t
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x firefox > /dev/null
|
||||
@ -26,5 +25,4 @@ if [ -n "$URL" ] && ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; t
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
@ -1,29 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="gimp"
|
||||
PGREP="gimp"
|
||||
MAXIMUS="true"
|
||||
DEFAULT_ARGS=""
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit
|
||||
eval set -- "$options"
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x gimp > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
gimp $ARGS &
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,28 +1,83 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="vmware-view"
|
||||
PGREP="vmware-view"
|
||||
MAXIMUS="false"
|
||||
DEFAULT_ARGS="--fullscreen"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
cd $HOME
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x vmware-view > /dev/null
|
||||
then
|
||||
cd $HOME
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
vmware-view $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
cd $HOME
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,29 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="insomnia"
|
||||
PGREP="insomnia"
|
||||
MAXIMUS="true"
|
||||
DEFAULT_ARGS="--no-sandbox"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit
|
||||
eval set -- "$options"
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x insomnia > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
insomnia $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,27 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="/usr/bin/maltego"
|
||||
PGREP="maltego"
|
||||
MAXIMUS="false"
|
||||
DEFAULT_ARGS=""
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x maltego > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
/usr/bin/maltego $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,29 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="onlyoffice-desktopeditors"
|
||||
PGREP="DesktopEditors"
|
||||
MAXIMUS="true"
|
||||
DEFAULT_ARGS="--system-title-bar"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit
|
||||
eval set -- "$options"
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x DesktopEditors >> /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
onlyoffice-desktopeditors $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,29 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="/opt/Postman/Postman"
|
||||
PGREP="Postman"
|
||||
MAXIMUS="true"
|
||||
DEFAULT_ARGS=""
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit
|
||||
eval set -- "$options"
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x Postman > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
/opt/Postman/Postman $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,28 +1,82 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="rdesktop"
|
||||
PGREP="rdesktop"
|
||||
MAXIMUS="false"
|
||||
DEFAULT_ARGS="-f localhost "
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x rdesktop > /dev/null
|
||||
then
|
||||
cd $HOME
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
rdesktop $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
cd $HOME
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,28 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -x
|
||||
FORCE=$1
|
||||
|
||||
DEFAULT_ARGS=" "
|
||||
set -ex
|
||||
START_COMMAND="remmina"
|
||||
PGREP="remmina"
|
||||
DEFAULT_ARGS=""
|
||||
MAXIMUS="false"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x remmina > /dev/null
|
||||
then
|
||||
cd $HOME
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
remmina $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,29 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="signal-desktop"
|
||||
PGREP="signal-desktop"
|
||||
DEFAULT_ARGS="--no-sandbox"
|
||||
MAXIMUS="true"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit
|
||||
eval set -- "$options"
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x signal-desktop > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
signal-desktop $ARGS
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,29 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="slack"
|
||||
PGREP="slack"
|
||||
MAXIMUS="true"
|
||||
DEFAULT_ARGS="--no-sandbox"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit
|
||||
eval set -- "$options"
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x slack > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
slack $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,29 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="/usr/games/steam"
|
||||
PGREP="steam"
|
||||
MAXIMUS="true"
|
||||
DEFAULT_ARGS=""
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit
|
||||
eval set -- "$options"
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x steam > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
/usr/games/steam $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,29 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="/opt/sublime_text/sublime_text"
|
||||
PGREP="sublime_text"
|
||||
MAXIMUS="true"
|
||||
DEFAULT_ARGS=""
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit
|
||||
eval set -- "$options"
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x sublime_text > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
/opt/sublime_text/sublime_text $ARGS &
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,29 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="teams"
|
||||
PGREP="teams"
|
||||
MAXIMUS="true"
|
||||
DEFAULT_ARGS="--no-sandbox"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit
|
||||
eval set -- "$options"
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x teams > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
teams $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,29 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
DEFAULT_ARGS=""
|
||||
START_COMMAND="/opt/Telegram/Telegram"
|
||||
PGREP="Telegram"
|
||||
MAXIMUS="false"
|
||||
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
|
||||
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
# 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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x Telegram > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
/opt/Telegram/Telegram $ARGS &
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,32 +1,82 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$2
|
||||
if [ -n "$1" ] ; then
|
||||
URL=$1
|
||||
else
|
||||
URL=$LAUNCH_URL
|
||||
fi
|
||||
|
||||
START_COMMAND="xfce4-terminal"
|
||||
PGREP="xfce4-terminal "
|
||||
MAXIMUS="false"
|
||||
DEFAULT_ARGS="--fullscreen --hide-borders --hide-menubar --zoom=-1 --hide-scrollbar"
|
||||
ARGS=${TERMINAL_ARGS:-$DEFAULT_ARGS}
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x xfce4-terminal > /dev/null
|
||||
then
|
||||
cd $HOME
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
xfce4-terminal $ARGS
|
||||
set -e
|
||||
|
||||
# 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
|
||||
$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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
cd $HOME
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,29 +1,84 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$2
|
||||
if [ -n "$1" ] ; then
|
||||
URL=$1
|
||||
else
|
||||
URL=$LAUNCH_URL
|
||||
fi
|
||||
START_COMMAND="$HOME/tor-browser/tor-browser_en-US/Browser/start-tor-browser"
|
||||
PGREP="firefox.real"
|
||||
MAXIMUS="false"
|
||||
DEFAULT_ARGS="--detach --allow-remote --new-tab"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
if [ -n "$URL" ] && ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
set +e
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
set -e
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep firefox > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$HOME/tor-browser/tor-browser_en-US/Browser/start-tor-browser --detach --allow-remote --new-tab $URL
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,28 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="vlc"
|
||||
PGREP="vlc"
|
||||
MAXIMUS="true"
|
||||
DEFAULT_ARGS="--no-metadata-network-access --no-qt-privacy-ask"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x vlc >> /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
vlc $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,29 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="code"
|
||||
PGREP="code"
|
||||
MAXIMUS="true"
|
||||
DEFAULT_ARGS="--no-sandbox"
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit
|
||||
eval set -- "$options"
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x code > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
code $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,28 +1,83 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="zoom"
|
||||
PGREP="zoom"
|
||||
MAXIMUS="true"
|
||||
DEFAULT_ARGS=""
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x zoom >> /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
zoom $ARGS
|
||||
set -e
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
@ -1,29 +1,80 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
FORCE=$1
|
||||
|
||||
START_COMMAND="zsnes"
|
||||
PGREP="zsnes"
|
||||
MAXIMUS="true"
|
||||
DEFAULT_ARGS=""
|
||||
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
|
||||
|
||||
options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit
|
||||
eval set -- "$options"
|
||||
|
||||
maximus &
|
||||
if ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
|
||||
if [ -f /tmp/custom_startup.lck ] ; then
|
||||
echo "custom_startup already running!"
|
||||
exit 1
|
||||
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
|
||||
$START_COMMAND $ARGS $OPT_URL
|
||||
else
|
||||
echo "No URL specified for exec command. Doing nothing."
|
||||
fi
|
||||
touch /tmp/custom_startup.lck
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x zsnes > /dev/null
|
||||
then
|
||||
/usr/bin/desktop_ready
|
||||
/usr/bin/filter_ready
|
||||
set +e
|
||||
zsnes $ARGS
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
rm /tmp/custom_startup.lck
|
||||
fi
|
||||
}
|
||||
|
||||
kasm_startup() {
|
||||
if [ -n "$KASM_URL" ] ; then
|
||||
URL=$KASM_URL
|
||||
elif [ -z "$URL" ] ; then
|
||||
URL=$LAUNCH_URL
|
||||
fi
|
||||
|
||||
if [[ $MAXIMUS == 'true' ]] ; then
|
||||
maximus &
|
||||
fi
|
||||
|
||||
if [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ; then
|
||||
while true
|
||||
do
|
||||
if ! pgrep -x $PGREP > /dev/null
|
||||
then
|
||||
/usr/bin/filter_ready
|
||||
/usr/bin/desktop_ready
|
||||
set +e
|
||||
$START_COMMAND $ARGS $URL
|
||||
set -e
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then
|
||||
kasm_exec
|
||||
else
|
||||
kasm_startup
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user