2024-08-23 11:44:27 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-10-07 15:19:00 +02:00
|
|
|
set -o errexit
|
|
|
|
|
|
|
|
APPL_HOME_DIR="$(dirname "$(dirname "$0")")"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
2024-08-23 17:42:22 +02:00
|
|
|
if [[ "$1" == "-h" ]]
|
|
|
|
then
|
|
|
|
echo "usage: run.sh [-h] [-i] <Application_Dir> <Application_Exec> [Args...]"
|
|
|
|
echo "with -i enabling internet access."
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$1" == "-i" ]]
|
|
|
|
then
|
|
|
|
shift;
|
|
|
|
export APPL_NETWORK="internet"
|
|
|
|
else
|
|
|
|
export APPL_NETWORK="no-internet"
|
|
|
|
fi
|
|
|
|
|
|
|
|
export APPL_DIR="$1"
|
2024-08-23 11:44:27 +02:00
|
|
|
shift
|
|
|
|
|
|
|
|
export APPL_NAME="$1"
|
|
|
|
shift
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export USER_ID=$(id -u)
|
|
|
|
export GROUP_ID=$(id -g)
|
|
|
|
export GROUP_NAME=$(id -gn)
|
|
|
|
|
|
|
|
|
2024-10-07 15:19:00 +02:00
|
|
|
cd "${APPL_HOME_DIR}"
|
|
|
|
|
|
|
|
sbin/docker_mk_env
|
|
|
|
|
2024-11-18 00:06:21 +01:00
|
|
|
docker compose run --rm x11-pulse /usr/local/sbin/user_add_exec ${USER_ID} ${USER} ${HOME} ${GROUP_ID} ${GROUP_NAME} ${APPL_DIR}/${APPL_NAME} $*
|