forked from LedgerHQ/app-bitcoin-clone-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
selection.sh
executable file
·81 lines (77 loc) · 1.98 KB
/
selection.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
#!/bin/bash
# Define SDKs (these should be environment variables already defined)
NANOS_SDK=${NANOS_SDK}
NANOSP_SDK=${NANOSP_SDK}
NANOX_SDK=${NANOX_SDK}
FLEX_SDK=${FLEX_SDK}
STAX_SDK=${STAX_SDK}
while true; do
echo "Which Ledger device do you have?"
echo "1) Ledger Nano S"
echo "2) Ledger Nano S+"
echo "3) Ledger Nano X"
echo "4) Ledger Flex"
echo "5) Ledger Stax"
echo "6) Exit"
read -r option
case $option in
1)
BOLOS_SDK=$NANOS_SDK
;;
2)
BOLOS_SDK=$NANOSP_SDK
;;
3)
BOLOS_SDK=$NANOX_SDK
;;
4)
BOLOS_SDK=$FLEX_SDK
;;
5)
BOLOS_SDK=$STAX_SDK
;;
6)
exit 0
;;
*)
echo "Invalid option. Please select again."
continue
;;
esac
while true; do
echo "Is the device connected, unlocked, and not in any application? (Yes/No)"
read -r response
case $response in
Yes|yes|YES|y|Y)
echo "Which operating system is the host running?"
echo "1) Linux"
echo "2) Windows"
echo "3) macOS"
read -r os_option
case $os_option in
1)
make load
exit 0
;;
2)
make
exit 0
;;
3)
make
exit 0
;;
*)
echo "Invalid option. Please select '1', '2', or '3'."
;;
esac
;;
No|no|NO|n|N)
break
;;
*)
echo "Invalid response. Please answer 'Yes' or 'No'."
;;
esac
done
done