45 lines
835 B
Bash
Executable File
45 lines
835 B
Bash
Executable File
#!/bin/bash
|
|
# This is the entryscript (PID 1) that runs inside the container
|
|
|
|
set -eu
|
|
|
|
CSK_PORT=${CSK_PORT:-5901}
|
|
|
|
main() {
|
|
|
|
if [[ ! -f /usr/bin/cardboard-sikuli ]] ; then
|
|
echo "Missing cardboard-sikuli binary" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Start xvfb
|
|
export DISPLAY=:99
|
|
|
|
Xvfb "$DISPLAY" -nolisten tcp -screen 0 1280x800x24 &
|
|
sleep 1
|
|
|
|
# Start icewm, x11vnc
|
|
|
|
xcompmgr &
|
|
sleep 1
|
|
icewm &
|
|
icewmbg
|
|
x11vnc -quiet -display "$DISPLAY" -bg -nopw -listen 0.0.0.0 -rfbport "$CSK_PORT" -xkb -bg
|
|
|
|
# Start cardboard-sikuli application, with any extra supplied arguments
|
|
# (e.g. --eval)
|
|
# Quit the rest of the container when cardboard-sikuli exits
|
|
|
|
/usr/bin/cardboard-sikuli &
|
|
CSK_PID="$!"
|
|
|
|
echo "###"
|
|
echo " Cardboard-sikuli is now running - connect to VNC on port :${CSK_PORT}"
|
|
echo "###"
|
|
|
|
wait $CSK_PID
|
|
exit "$?"
|
|
}
|
|
|
|
main "$@"
|