-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch-eclipse.sh
More file actions
executable file
·35 lines (30 loc) · 886 Bytes
/
Copy pathlaunch-eclipse.sh
File metadata and controls
executable file
·35 lines (30 loc) · 886 Bytes
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
#!/bin/bash
# Check if DISPLAY is set
if [ -z "$DISPLAY" ]; then
echo "DISPLAY environment variable is not set. Please set DISPLAY to the X11 server you want to use."
echo "Example: export DISPLAY=:0"
echo "Example: export DISPLAY=:10 (if you are using xRDP)"
exit 1
fi
# Check if container id is provided
if [ -z "$1" ]; then
echo "Container id is not provided."
echo "Usage: ./launch-eclipse.sh <container_id>"
echo "docker ps -a"
docker ps -a
exit 1
fi
# Check if container id is valid
if [ -z "$(docker ps -a --filter "id=$1")" ]; then
echo "Container id $1 is not valid."
echo "docker ps -a"
docker ps -a
exit 1
fi
# Check if container is running
if [ -z "$(docker ps -q --filter "id=$1")" ]; then
echo "Container $1 is not running."
echo "Starting the container $1"
docker start $1
fi
docker exec -it $1 eclipse