balena-supervisor/src/enterContainer.sh

12 lines
405 B
Bash
Raw Normal View History

2014-08-04 12:10:36 +01:00
SOCKET_NAME=test-${1}-${2}-${3}
HOST_DATA_PATH=/resin-data/resin-supervisor
HOST_SOCKET=${HOST_DATA_PATH}/${SOCKET_NAME}
SUPERVISOR_SOCKET_PATH=/data
echo "
rm -f ${HOST_SOCKET}
socat UNIX-LISTEN:${HOST_SOCKET} EXEC:'${HOST_DATA_PATH}/enter.sh ${1}',pty,setsid,setpgid,stderr,ctty &
exit
" | socat UNIX:${SUPERVISOR_SOCKET_PATH}/host -
socat UNIX:${SUPERVISOR_SOCKET_PATH}/${SOCKET_NAME} -,raw,echo=0