forked from ChainSafe/lodestar-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse-args.sh
executable file
·94 lines (90 loc) · 2.3 KB
/
parse-args.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
#!/bin/sh
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--elClient)
elClient="$2"
shift # past argument
shift # past value
;;
--dataDir)
dataDir="$2"
shift # past argument
shift # past value
;;
--network)
network="$2"
shift # past argument
shift # past value
;;
--withTerminal)
withTerminal="$2"
shift # past argument
shift # past value
;;
--dockerWithSudo)
dockerWithSudo=true
shift # past argument
;;
--withValidatorMnemonic)
withValidatorMnemonic=true
shift # past argument
;;
--withValidatorKeystore)
withValidatorKeystore="$2"
shift # past argument
shift # past value
;;
--justEL)
justEL=true
shift # past argument
;;
--justCL)
justCL=true
shift # past argument
;;
--justVC)
justVC=true
shift # past argument
;;
--detached)
detached=true
shift # past argument
;;
--skipImagePull)
skipImagePull=true
shift # past argument
;;
--justMevBoost)
justMevBoost=true
shift
;;
--withMevBoost)
withMevBoost=true
shift
;;
*) # unknown option
shift # past argument
;;
esac
done
# key won't ever get assigned in while loop if there is no arg, in that case print usage
if [[ ! -n "$key" ]];
then
echo "usage: ./setup.sh --dataDir <data dir> --elClient <geth | nethermind | reth | ethereumjs | besu | erigon> --devetVars <devnet vars file> [--dockerWithSudo --withTerminal --withMevBoost \"gnome-terminal --disable-factory --\"]"
echo "example: ./setup.sh --dataDir sepolia-data --elClient nethermind --network sepolia --dockerWithSudo --withTerminal \"gnome-terminal --disable-factory --\""
echo "Note: if running on macOS where gnome-terminal is not available, remove the gnome-terminal related flags."
echo "example: ./setup.sh --dataDir sepolia-data --elClient geth --network sepolia"
exit;
fi;
if [ -n "$network" ]
then
devnetVars="$scriptDir/$network.vars"
fi;
echo "scriptDir = $scriptDir"
echo "currentDir = $currentDir"
echo "elClient = $elClient"
echo "dataDir = $dataDir"
echo "devnetVars = $devnetVars"
echo "withTerminal = $withTerminal"
echo "dockerWithSudo = $dockerWithSudo"