x11-pulse/bin/run.sh
Arnaud G. GIBERT 1ec6476ff6 - Move & Rename repo from Rx3/X11-Pulse-MGA9 to Rx3-Docker/X11-Pulse,
- New version naming standard,
- Now use docker_tools for .env building,
- Now use docker_service_add macro,
- Use now rx3-docker/base:1.3.0-mga9 image,
- Create src bin & dir/sbin directories.
2024-11-18 00:09:46 +01:00

45 lines
783 B
Bash
Executable File

#!/bin/bash
set -o errexit
APPL_HOME_DIR="$(dirname "$(dirname "$0")")"
#-------------------------------------------------------------------------------
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"
shift
export APPL_NAME="$1"
shift
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
export GROUP_NAME=$(id -gn)
cd "${APPL_HOME_DIR}"
sbin/docker_mk_env
docker compose run --rm x11-pulse /usr/local/sbin/user_add_exec ${USER_ID} ${USER} ${HOME} ${GROUP_ID} ${GROUP_NAME} ${APPL_DIR}/${APPL_NAME} $*