-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathreset.sh
executable file
·41 lines (31 loc) · 968 Bytes
/
reset.sh
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
#!/bin/bash
set -eu
cd "$(dirname "$0")"
# this script destroys everything -- including output files -- then brings everything back up.
. ./defaults.env
. ./.env
./down.sh
ANSWER=n
read -r -e -p "Would you like to delete (non cert) volumes?" ANSWER
if [ "$ANSWER" = y ]; then
# check dependencies
for VOLUME in bitcoind clightning www-root; do
if docker volume list | grep -q "$VOLUME"; then
docker volume rm "$VOLUME" > /dev/null 2>&1
fi
done
# clear dangling volumes
for VOLUME in $(docker volume ls -q --filter dangling=true); do
if [ "$VOLUME" != clams-certs ]; then
docker volume rm "$VOLUME" > /dev/null 2>&1
fi
done
fi
ANSWER=n
read -r -e -p "Would you like to delete the certificate store? " ANSWER
if [ "$ANSWER" = y ]; then
if docker volume list | grep -q "clams-certs"; then
docker volume rm "clams-certs" > /dev/null 2>&1
fi
fi
docker system prune -f