-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChaChing.sh
98 lines (62 loc) · 2.82 KB
/
ChaChing.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
source /home/user/ChaChing.cfg
NEWLINE=$'\n'
echo $(date)
function push {
curl -s -F "token=$token" \
-F "user=$user" \
-F "title=$title" \
-F "message=$1" https://api.pushover.net/1/messages.json
}
#Check Chia wallet
bal=`docker exec machinaris chia wallet show | grep ' .Total Balance:' | cut --fields 6 --delimiter=\ | head -n 1`
echo "Chia - $bal"
lastbal=`cat /home/user/ChaChing/walletbalance.chia`
if [ "$bal" != "$lastbal" ]; then
echo $bal >/home/user/ChaChing/walletbalance.chia
change=$(echo "$bal - $lastbal" | bc)
title="Chia balance change!"
alert="Balance changed by $change ${NEWLINE}New balance = ${bal}"
push "$alert" >> /dev/null
fi
#Check Silicoin Wallet
bal=`docker exec coctohug-silicoin sit wallet show | grep ' .Total Balance:' | cut --fields 6 --delimiter=\ | head -n 1`
echo "Silicoin - $bal"
lastbal=`cat /home/user/ChaChing/walletbalance.silicoin`
if [ "$bal" != "$lastbal" ]; then
echo $bal >/home/user/ChaChing/walletbalance.silicoin
change=$(echo "$bal - $lastbal" | bc)
title="Silicoin balance change!"
alert="Balance changed by $change ${NEWLINE}New balance = ${bal}"
push "$alert" >> /dev/null
fi
forks="BTCGreen Cactus Chives CryptoDoge Flax Flora HDDCoin Maize NChain StaiCoin STOR"
for fork in ${forks[@]}
do
lowerfork=`echo $fork | tr '[:upper:]' '[:lower:]'`
bal=`docker exec machinaris-${lowerfork[@]} ${lowerfork[@]} wallet show | grep ' .Total Balance:' | cut --fields 6 --delimiter=\ | head -n 1`
echo "$fork - $bal"
lastbal=`cat /home/user/ChaChing/walletbalance.${lowerfork[@]}`
if [ "$bal" != "$lastbal" ]; then
echo $bal >/home/user/ChaChing/walletbalance.${lowerfork[@]}
change=$(echo "$bal - $lastbal" | bc)
title="${fork[@]} balance change!"
alert="Balance changed by $change ${NEWLINE}New balance = ${bal}"
push "$alert" >> /dev/null
fi
done
forks="AEdge Apple Covid Lucky Mint Pipscoin SkyNet Socks Taco Tad Tranzact Venidium Wheat"
for fork in ${forks[@]}
do
lowerfork=`echo $fork | tr '[:upper:]' '[:lower:]'`
bal=`docker exec coctohug-${lowerfork[@]} ${lowerfork[@]} wallet show | grep ' .Total Balance:' | cut --fields 6 --delimiter=\ | head -n 1`
echo "$fork - $bal"
lastbal=`cat /home/user/ChaChing/walletbalance.${lowerfork[@]}`
if [ "$bal" != "$lastbal" ]; then
echo $bal >/home/user/ChaChing/walletbalance.${lowerfork[@]}
change=$(echo "$bal - $lastbal" | bc)
title="${fork[@]} balance change!"
alert="Balance changed by $change ${NEWLINE}New balance = ${bal}"
push "$alert" >> /dev/null
fi
done