-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathreset-all.sh
More file actions
executable file
·36 lines (29 loc) · 907 Bytes
/
reset-all.sh
File metadata and controls
executable file
·36 lines (29 loc) · 907 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
36
#!/bin/sh
container_stop_and_remove()
{
name="$1"
# Check if container is running.
if test "$(docker container inspect -f '{{.State.Running}}' "$name" 2> /dev/null)" = "true"; then
# Stop container if it running.
echo "Stopping container $name ... "
docker stop "$name"
fi
# Check if container exists.
docker container inspect "$name" > /dev/null 2>&1
if test $? -eq 0; then
# Remove container if it exists.
echo "Removing container $name ... "
docker rm "$name"
fi
}
container_stop_and_remove "cdl-nginx"
container_stop_and_remove "ctf-piece_of_pie"
container_stop_and_remove "cdl-caddy"
container_stop_and_remove "cdl-debian-bash"
# Start Nginx container.
./vanilla-nginx/run-nginx-container.sh
# Start CTF container.
cd ctf/deploy
make run
# Stop CTF container (for initial environment).
docker stop ctf-piece_of_pie