diff options
Diffstat (limited to 'docker-ep.sh')
-rwxr-xr-x | docker-ep.sh | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/docker-ep.sh b/docker-ep.sh new file mode 100755 index 0000000..2f949f5 --- /dev/null +++ b/docker-ep.sh @@ -0,0 +1,80 @@ +#!/bin/bash +## +## entrypoint for the docker images + +groupmod -g $gid voc +usermod -u $uid -g $gid voc + +# check if homedir is mounted +if grep -q '/home/voc' /proc/mounts; then + # homedir is mounted into the docker so don't touch the ownership of the files + true +else + # fixup for changed uid and gid + chown -R voc:voc /home/voc +fi + +function startCore() { + if [ -x /bin/gosu ]; then + gosu voc /opt/voctomix/voctocore/voctocore.py -v + else + echo "no gosu found..." + exec su -l -c "/opt/voctomix/voctocore/voctocore.py -v" voc + fi +} + +function isVideoMounted() { + return grep -q '/video' /proc/mounts +} + +function startGui() { + if [ -x /bin/gosu ]; then + gosu voc /opt/voctomix/voctocore/voctocore.py -v + else + echo "no gosu found..." + exec su -l -c "/opt/voctomix/voctogui/voctogui.py -v" voc + fi +} + +function listExamples() { + cd example-scripts/ + find -type f +} + +function runExample() { + if [ -z $1 ]; then + echo "no valid example! " + fi + FILENAME="example-scripts/$1" + if [ -f ${FILENAME} ]; then + echo "Running: ${FILENAME}" + ${FILENAME} + fi +} + +function usage() { + echo "Usage: $0 <cmd>" + echo "help - this text" + echo "core - starts voctomix gore" + echo "gui - starts the voctomix GUI" + echo "examples - lists the example scripts" + echo "scriptname.py - starts the example script named 'scriptname.py' " +} + +case $1 in + help ) + usage + ;; + examples ) + listExamples + ;; + gui ) + startGui + ;; + core ) + startCore + ;; + * ) + runExample $1 + ;; +esac
\ No newline at end of file |