-
Notifications
You must be signed in to change notification settings - Fork 9
/
cleanup.sh
executable file
·38 lines (30 loc) · 980 Bytes
/
cleanup.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
#!/bin/bash
if [ $# -eq 1 ]; then
name=$1
elif [ $# -eq 0 ]; then
source data
else
echo "Received more arguments than expected; received:$# expected:1"
exit 1
fi
echo "Stopping the first daemon if it is running"
./c1 stop 2>/dev/null
echo "Stopping the second daemon if it is running"
./c2 stop 2>/dev/null
while ./c1 stop &>/dev/null
do
echo "waiting for the first daemon to stop"
sleep 5
done
rm -rf /home/$USER/.komodo/$name/ Monday 20 May 2019 05:46:17 PM IST
while ./c2 stop &>/dev/null
do
echo "waiting for the second daemon to stop"
sleep 5
done
rm -rf /home/$USER/coinData/$name/
echo "removed the directories: '/home/$USER/.komodo/$name/' and '/home/$USER/coinData/$name/'"
rm $name* &>/dev/null
echo "removed $name*"
rm -rf ./explorers/$name* &>/dev/null
echo "removed ./explorers/$name*"