forked from go140point6/xahl-evr-sweeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sweep-evr.sh
executable file
·34 lines (32 loc) · 962 Bytes
/
sweep-evr.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
#!/bin/bash
while getopts m: flag
do
case "${flag}" in
m) mode=${OPTARG};;
esac
done
if ! [[ $mode == simulation || $mode == sweep ]]; then
echo "The flag value for -m MUST be either simulation or sweep, no other value allowed."
echo "Simulation will run all operations EXCEPT actually making the sweep. Use it to see what will happen."
exit 1
elif [[ $mode == simulation ]]; then
echo "****"
echo "Running SIMULATION (no EVR being moved!)"
echo "****"
node index.js $mode
exit 0
elif [[ $mode == sweep ]]; then
echo "Running SWEEP, this will move EVR to your main wallet!"
echo "****"
read -r -p "Are you sure you want to continue? [y/N] " response
response=${response,,}
if [[ "$response" =~ ^(yes|y)$ ]]; then
echo "Confirmed... running SWEEP of Evernode nodes wallets."
node index.js $mode
exit 0
else
echo "Aborting..."
exit 1
fi
fi
exit 1