2014-08-19 17:46:38 +01:00
|
|
|
#!/bin/bash
|
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
|
2014-08-19 18:09:19 +01:00
|
|
|
COMMAND_SOCKET=${SUPERVISOR_SOCKET_PATH}/host
|
2014-08-04 12:10:36 +01:00
|
|
|
|
2014-08-19 18:09:19 +01:00
|
|
|
if [ ! -S ${COMMAND_SOCKET} ]; then
|
2014-12-08 17:59:30 +00:00
|
|
|
read -p 'TTY mode not supported on this image, please update.'
|
2014-08-19 18:09:19 +01:00
|
|
|
else
|
|
|
|
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:${COMMAND_SOCKET} - >& /dev/null
|
|
|
|
socat UNIX:${SUPERVISOR_SOCKET_PATH}/${SOCKET_NAME} -,raw,echo=0
|
|
|
|
fi
|