-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.sh
executable file
·220 lines (215 loc) · 3.76 KB
/
cli.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#!/bin/bash
SCRIPTPATH=$(realpath "$0")
SCRIPTFOLDER=$(dirname "$SCRIPTPATH")
source "$SCRIPTFOLDER/modules/globals.sh"
source "$SCRIPTFOLDER/modules/ap.sh"
source "$SCRIPTFOLDER/modules/apchannel.sh"
source "$SCRIPTFOLDER/modules/bluetooth.sh"
source "$SCRIPTFOLDER/modules/bridge.sh"
source "$SCRIPTFOLDER/modules/burn.sh"
source "$SCRIPTFOLDER/modules/button.sh"
source "$SCRIPTFOLDER/modules/bootoption.sh"
source "$SCRIPTFOLDER/modules/container.sh"
source "$SCRIPTFOLDER/modules/default.sh"
source "$SCRIPTFOLDER/modules/detect.sh"
source "$SCRIPTFOLDER/modules/detectrpi.sh"
source "$SCRIPTFOLDER/modules/ethernet.sh"
source "$SCRIPTFOLDER/modules/expandfs.sh"
source "$SCRIPTFOLDER/modules/feedback.sh"
source "$SCRIPTFOLDER/modules/internet.sh"
source "$SCRIPTFOLDER/modules/help.sh"
source "$SCRIPTFOLDER/modules/image.sh"
source "$SCRIPTFOLDER/modules/led.sh"
source "$SCRIPTFOLDER/modules/locale.sh"
source "$SCRIPTFOLDER/modules/networkmode.sh"
source "$SCRIPTFOLDER/modules/ntp.sh"
source "$SCRIPTFOLDER/modules/password.sh"
source "$SCRIPTFOLDER/modules/openvpn.sh"
source "$SCRIPTFOLDER/modules/rebootneeded.sh"
source "$SCRIPTFOLDER/modules/rename.sh"
source "$SCRIPTFOLDER/modules/restore.sh"
source "$SCRIPTFOLDER/modules/rtc.sh"
source "$SCRIPTFOLDER/modules/services.sh"
source "$SCRIPTFOLDER/modules/ssh.sh"
source "$SCRIPTFOLDER/modules/sshkey.sh"
source "$SCRIPTFOLDER/modules/sshkeyadd.sh"
source "$SCRIPTFOLDER/modules/sshtunnel.sh"
source "$SCRIPTFOLDER/modules/staticwifi.sh"
source "$SCRIPTFOLDER/modules/timezone.sh"
source "$SCRIPTFOLDER/modules/tor.sh"
source "$SCRIPTFOLDER/modules/upgrade.sh"
source "$SCRIPTFOLDER/modules/version.sh"
source "$SCRIPTFOLDER/modules/vnc.sh"
source "$SCRIPTFOLDER/modules/wifi.sh"
source "$SCRIPTFOLDER/modules/wificountry.sh"
source "$SCRIPTFOLDER/modules/clone.sh"
case $1 in
expandfs)
checkroot
expandfs
;;
rename)
checkroot
rename "$2"
;;
password)
checkroot
password "$2"
;;
sshkeyadd)
checkroot
shift
sshkeyadd "$@"
;;
sshkey)
checkroot
shift
sshkey "$@"
;;
version)
version
;;
image)
image
;;
detect)
detect
;;
detectrpi)
detectrpi
;;
wifi)
checkroot
wifi "$2" "$3"
;;
staticwifi)
checkroot
staticwifi "$2" "$3" "$4" "$5" "$6" "$7"
;;
container)
checkroot
container "$2"
;;
bluetooth)
checkroot
bluetooth "$2"
;;
ethernet)
checkroot
ethernet "$2" "$3" "$4" "$5"
;;
ap)
checkroot
shift
ap "$@"
;;
timezone)
checkroot
timezone "$2"
;;
locale)
checkroot
locale "$2"
;;
ssh)
checkroot
ssh "$2"
;;
vnc)
checkroot
vnc "$2"
;;
default)
checkroot
default "$2"
;;
upgrade)
shift
upgrade "$@"
;;
bridge)
checkroot
shift
bridge "$@"
;;
wificountry)
checkroot
wificountry "$2"
;;
sshtunnel)
checkroot
sshtunnel "$2" "$3" "$4"
;;
led)
led "$2" "$3"
;;
rtc)
checkroot
rtc "$2" "$3"
;;
ntp)
checkroot
ntp "$2"
;;
networkmode)
networkmode "$2"
;;
button)
checkroot
button "$2"
;;
feedback)
shift
feedback "$*"
;;
apchannel)
shift
apchannel "$1"
;;
clone)
checkroot
shift
clone "$1"
;;
restore)
checkroot
shift
restore "$1"
;;
burn)
checkroot
shift
burn "$1"
;;
rebootneeded)
rebootneeded
;;
internet)
internet
;;
services)
shift
services "$@"
;;
tor)
checkroot
shift
tor "$@"
;;
bootoption)
checkroot
shift
bootoption "$*"
;;
openvpn)
checkroot
shift
openvpn "$@"
;;
help)
help "$2"
;;
*)
help
;;
esac