-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathstop
More file actions
executable file
·56 lines (49 loc) · 1.37 KB
/
stop
File metadata and controls
executable file
·56 lines (49 loc) · 1.37 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#
# Stops all or a specific coin daemon
#
# @author webworker01
#
scriptpath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $scriptpath/main
if (( $thirdpartycoins < 1 )); then
searchlist="coinsfirst[@]"
else
searchlist="coinsthird[@]"
fi
if [[ -z "$1" ]]; then
log "stop" "stopping all"
pkill -15 komodod
for coins in "${!searchlist}"; do
searchcoin=($coins)
log "stop" "Stopping ${searchcoin[0]}"
eval $(echo coincli=${searchcoin[1]})
$coincli stop &
done
elif [[ "${1^^}" == "KMD" ]]; then
log "stop" "stopping KMD"
$komodocli stop &
else
#search
for coins in "${!searchlist}"; do
searchcoin=($coins)
coin=($coins)
if [[ -z "$1" || "${1^^}" == "${searchcoin[0]}" ]]; then
log "stop" "Stopping ${searchcoin[0]}"
eval $(echo coincli=${searchcoin[1]})
$coincli stop &
fi
done
if (( $thirdpartycoins < 1 )); then
for coins in "${coinlist[@]}"; do
coin=($coins)
if [[ -z "$1" || "${1^^}" == "${coin[0]}" ]]; then
log "stop" "Stopping ${coin[0]}"
$komodocli -ac_name=${1^^} stop &
if [[ -f "${scriptpath}/pid/${1^^}" ]]; then
rm "${scriptpath}/pid/${1^^}"
fi
fi
done
fi
fi