-
Notifications
You must be signed in to change notification settings - Fork 2
/
voter_dice.sh
33 lines (30 loc) · 949 Bytes
/
voter_dice.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
#!/bin/sh
mkdir -p ~/.votes
proposals=$(~/navcoin-core/src/navcoin-cli -testnet listproposals|jq -r ".[]|.hash")
for i in $proposals;
do
if [ ! -e "$HOME/.votes/${i}" ];
then
dice=$(bc <<< "$RANDOM % 2")
if [ $dice -eq 1 ];
then
~/navcoin-core/src/navcoin-cli -testnet proposalvote $i yes && echo yes > ~/.votes/$i
else
~/navcoin-core/src/navcoin-cli -testnet proposalvote $i no && echo no > ~/.votes/$i
fi
fi
done
prequests=$(~/navcoin-core/src/navcoin-cli -testnet listproposals|jq -r ".[]|.paymentRequests|.hash?")
for i in $prequests;
do
if [ ! -e "$HOME/.votes/${i}" ];
then
dice=$(bc <<< "$RANDOM % 2")
if [ $dice -eq 1 ];
then
~/navcoin-core/src/navcoin-cli -testnet paymentrequestvote $i yes && echo yes > ~/.votes/$i
else
~/navcoin-core/src/navcoin-cli -testnet paymentrequestvote $i no && echo no > ~/.votes/$i
fi
fi
done