-
Notifications
You must be signed in to change notification settings - Fork 1
/
macQS
57 lines (54 loc) · 1.36 KB
/
macQS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# To use this script, please right click and Save As macQS.sh
xcode-select -p
if [ $? != 0 ]
then
echo "Please install XCode Command Line Tools with: xcode-select --install "
exit 1
fi
which -s socat
if [ $? != 0 ]
then
which -s brew
if [ $? != 0 ]
then
which -s port
if [ $? != 0 ]
then
echo "Please install Homebrew from: "
echo "https://brew.sh/"
exit 1
else
echo "Please install socat using MacPorts: "
echo "sudo port install socat"
exit 1
fi
else
echo "Please install socat using Homebrew: "
echo "brew install socat"
exit 1
fi
fi
which -s docker
if [ $? != 0 ]
then
echo "Please install Docker Desktop for MacOSX: "
echo "https://docs.docker.com/docker-for-mac/install/"
exit 1
fi
if (! docker stats --no-stream &>/dev/null )
then
echo "Launching Docker"
open /Applications/Docker.app
while (! docker stats --no-stream &>/dev/null )
do
echo "..."
sleep 5
done
fi
open -a "Terminal"
osascript -e 'tell application "Terminal" to do script "socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\\\"$DISPLAY\\\""'
A=`ipconfig getifaddr en0`
C=":0 compbiocore/nmrdock:latest /bin/bash"
B="docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -v `pwd`:/home/ubuntu/data/ -w /home/ubuntu/data/ -e DISPLAY=$A$C"
exec $B