-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathscanresetwallets
More file actions
executable file
·60 lines (54 loc) · 1.58 KB
/
scanresetwallets
File metadata and controls
executable file
·60 lines (54 loc) · 1.58 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
57
58
59
60
#!/bin/bash
#
# Scan and reset wallets over size limit
#
# @author webworker01
#
scriptpath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $scriptpath/main
#check kmd
walletsize=$(ls -l ~/.komodo/wallet.dat | awk '{print $5}')
if (( $walletsize > $monitorsizekmd )); then
log "scanresetwallets" "KMD - $walletsize"
$scriptpath/resetwallet "KMD"
fi
if (( $thirdpartycoins < 1 )); then
searchlist="coinsfirst[@]"
else
searchlist="coinsthird[@]"
fi
for coins in "${!searchlist}"; do
coin=($coins)
walletsize=$(ls -l ~/${coin[3]}/wallet.dat | awk '{print $5}')
if [[ ${komodolike[*]} =~ ${coin[0]} ]]; then
monitorsizeother=$monitorsize
fi
if (( $walletsize > $monitorsizeother )); then
log "scanresetwallets" "${coin[0]} - $walletsize"
case ${coin[4]} in
kmd)
$scriptpath/resetwallet ${coin[0]}
;;
newaddress)
$scriptpath/resetwalletnewaddress ${coin[0]}
;;
rescan)
$scriptpath/resetwalletrescan ${coin[0]}
;;
zimport)
$scriptpath/resetwallet ${coin[0]} 2
;;
esac
fi
done
#check acs
if (( $thirdpartycoins < 1 )); then
for coins in "${coinlist[@]}"; do
coin=($coins)
walletsize=$(ls -l ~/.komodo/${coin[0]}/wallet.dat | awk '{print $5}')
if (( $walletsize > $monitorsize )); then
log "scanresetwallets" "${coin[0]} - $walletsize"
$scriptpath/resetwallet ${coin[0]}
fi
done
fi