Skip to content
Snippets Groups Projects
Commit 8051d1e1 authored by jurgenhaas's avatar jurgenhaas
Browse files

#25 Improve MacOS support and fix some bugs

parent b5f03a4c
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
L3DHOSTOS="$(uname -s)"
SSHAUTH=${SSH_AUTH_SOCK}
SSHAUTHSOCK=/ssh-agent
L3DHOSTOS="$(uname -s)"
case "${L3DHOSTOS}" in
Darwin*)
if ! which greadlink >/dev/null; then
# This only works if no symlinks are involved.
SCRIPTPATH="$(cd "$(dirname "$0")" && pwd -p)"
else
# This works on MacOS when coreutils is installed.
SCRIPTPATH="$(dirname "$(greadlink -f "$0")")"
fi
${SCRIPTPATH}/prepareMac4L3d
if [[ $? > 0 ]]; then
exit $?
fi
;;
*)
# This works in most cases, i.e. on Linux.
SCRIPTPATH="$(dirname "$(readlink -f "$0")")"
esac
ID=$(docker container ls --all -q -f name=^l3drun$)
......
......@@ -2,9 +2,9 @@
# Credit: https://github.com/mariusgrigaitis/docker-mac-ssh-auth-sock
SOCATID=$(docker container ls --all -q -f name=^l3d_socat$)
SOCATID=$(docker container ls --all -q -f name=l3d_socat)
if [[ -n ${SOCATID} ]]; then
return
exit 0
fi
if ! which socat >/dev/null; then
......@@ -75,4 +75,4 @@ echo "Starting socket proxy."
#
# This is not really reliable because forwarding input/output over stdin/stdout does not allow for multiple communications
# at the same time. It fails when doing multiple connections to $SSH_AUTH_SOCK at the same time.
exec socat "EXEC:\"docker run -i -d --rm --restart unless-stopped --name l3d_socat -v $(dirname $SSH_AUTH_SOCK):$(dirname $SSH_AUTH_SOCK) alpine/socat UNIX-LISTEN:$SSH_AUTH_SOCK,reuseaddr,fork -\"" "EXEC:\"socat - UNIX:${SSH_AUTH_SOCK}\""
exec socat "EXEC:\"docker run -i --rm --name l3d_socat -v $(dirname $SSH_AUTH_SOCK):$(dirname $SSH_AUTH_SOCK) alpine/socat UNIX-LISTEN:$SSH_AUTH_SOCK,reuseaddr,fork -\"" "EXEC:\"socat - UNIX:${SSH_AUTH_SOCK}\"" &
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment