Commit 13cf4fd7b91c7411df0ebbe2242e546a8df880e4
1 parent
5e20d431fc
Exists in
master
and in
2 other branches
Add hetzner_delete script
Showing 2 changed files with 21 additions and 1 deletions
delete_hetzner.sh
View file @
13cf4fd
1 | +#!/bin/bash | |
2 | +# Stop containers and removes containers, networks, volumes, and images | |
3 | +docker-compose -f docker-compose-hetzner.yml down | |
4 | +docker volume ls | \ | |
5 | + grep kea_ | \ | |
6 | + tr -s ' ' | \ | |
7 | + cut -d' ' -f2 | \ | |
8 | + xargs docker volume rm | |
9 | + | |
10 | +# Wait a bit | |
11 | +sleep 5s | |
12 | + | |
13 | +# Check that containers were removed succesfully | |
14 | +res=`docker ps -a | grep "/curex-local/kea_" | wc -l` | |
15 | +if [ $res -ne 0 ]; then | |
16 | + echo "ERROR: Some KEA containers have not been removed." | |
17 | + docker ps -a | |
18 | + exit 1 | |
19 | +fi |