-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Extern.bat
executable file
·269 lines (226 loc) · 10.6 KB
/
Extern.bat
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
@echo off
if "%1" == "dl" (
echo y | pscp -scp -pw %3 root@%2:/etc/majestic.yaml .
echo y | pscp -scp -pw %3 root@%2:/etc/wfb.conf .
echo y | pscp -scp -pw %3 root@%2:/etc/telemetry.conf .
)
if "%1" == "ul" (
echo y | pscp -scp -pw %3 majestic.yaml root@%2:/etc
echo y | pscp -scp -pw %3 wfb.conf root@%2:/etc
echo y | pscp -scp -pw %3 telemetry.conf root@%2:/etc
plink -ssh root@%2 -pw %3 dos2unix /etc/wfb.conf /etc/telemetry.conf /etc/majestic.yaml
)
if "%1" == "ulr" (
echo y | pscp -scp -pw %3 majestic.yaml root@%2:/etc
echo y | pscp -scp -pw %3 wfb.conf root@%2:/etc
echo y | pscp -scp -pw %3 telemetry.conf root@%2:/etc
plink -ssh root@%2 -pw %3 dos2unix /etc/wfb.conf /etc/telemetry.conf /etc/majestic.yaml
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "dlvrx" (
echo y | pscp -scp -pw %3 root@%2:/etc/vdec.conf .
echo y | pscp -scp -pw %3 root@%2:/etc/wfb.conf .
echo y | pscp -scp -pw %3 root@%2:/etc/telemetry.conf .
)
if "%1" == "ulvrx" (
echo y | pscp -scp -pw %3 vdec.conf root@%2:/etc
echo y | pscp -scp -pw %3 wfb.conf root@%2:/etc
echo y | pscp -scp -pw %3 telemetry.conf root@%2:/etc
plink -ssh root@%2 -pw %3 dos2unix /etc/wfb.conf /etc/telemetry.conf /etc/vdec.conf
)
if "%1" == "ulvrxr" (
echo y | pscp -scp -pw %3 vdec.conf root@%2:/etc
echo y | pscp -scp -pw %3 wfb.conf root@%2:/etc
echo y | pscp -scp -pw %3 telemetry.conf root@%2:/etc
plink -ssh root@%2 -pw %3 dos2unix /etc/wfb.conf /etc/telemetry.conf /etc/vdec.conf
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "dlwfbng" (
echo y | pscp -scp -pw %3 root@%2:/etc/wifibroadcast.cfg .
echo y | pscp -scp -pw %3 root@%2:/etc/modprobe.d/wfb.conf .
echo y | pscp -scp -pw %3 root@%2:/config/scripts/screen-mode .
echo y | pscp -scp -pw %3 root@%2:/etc/default/wifibroadcast .
)
if "%1" == "ulwfbng" (
plink -ssh root@%2 -pw %3 apt install dos2unix
echo y | pscp -scp -pw %3 wifibroadcast.cfg root@%2:/etc
echo y | pscp -scp -pw %3 wfb.conf root@%2:/etc/modprobe.d/
echo y | pscp -scp -pw %3 screen-mode root@%2:/config/scripts/
plink -ssh root@%2 -pw %3 dos2unix /etc/wifibroadcast.cfg /etc/modprobe.d/wfb.conf /config/scripts/screen-mode
)
if "%1" == "ulwfbngr" (
plink -ssh root@%2 -pw %3 apt install dos2unix
echo y | pscp -scp -pw %3 wifibroadcast.cfg root@%2:/etc
echo y | pscp -scp -pw %3 wfb.conf root@%2:/etc/modprobe.d/
echo y | pscp -scp -pw %3 screen-mode root@%2:/config/scripts/
plink -ssh root@%2 -pw %3 dos2unix /etc/wifibroadcast.cfg /etc/modprobe.d/wfb.conf /config/scripts/screen-mode
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "rb" (
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "sysup" (
plink -ssh root@%2 -pw %3 sysupgrade -k -r -n --force_ver
)
if "%1" == "keysdlgs" (
echo y | pscp -scp -pw %3 root@%2:/root/drone.key .
)
if "%1" == "keysdlcam" (
echo y | pscp -scp -pw %3 root@%2:/etc/drone.key .
)
if "%1" == "keysulgs" (
echo y | pscp -scp -pw %3 drone.key root@%2:/etc
plink -ssh root@%2 -pw %3 cp /etc/drone.key /etc/gs.key
)
if "%1" == "keysulcam" (
echo y | pscp -scp -pw %3 drone.key root@%2:/etc
)
if "%1" == "keysgen" (
plink -ssh root@%2 -pw %3 wfb_keygen
plink -ssh root@%2 -pw %3 cp /root/gs.key /etc/
)
if "%1" == "UART0on" (
plink -ssh root@%2 -pw %3 sed -i 's/console::respawn:\/sbin\/getty -L console 0 vt100/#console::respawn:\/sbin\/getty -L console 0 vt100/' /etc/inittab
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "UART0off" (
plink -ssh root@%2 -pw %3 sed -i 's/#console::respawn:\/sbin\/getty -L console 0 vt100/console::respawn:\/sbin\/getty -L console 0 vt100/' /etc/inittab
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "extra" (
plink -ssh root@%2 -pw %3 sed -i 's/mavfwd --channels \"$channels\" --master \"$serial\" --baudrate \"$baud\" -p 100 -t -a \"$aggregate\" \\/mavfwd --channels \"$channels\" --master \"$serial\" --baudrate \"$baud\" -a \"$aggregate\" --wait 5 --persist 50 -t \\/' /usr/bin/telemetry
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "rswfb" (
plink -ssh root@%2 -pw %3 wifibroadcast stop
plink -ssh root@%2 -pw %3 sleep 3
plink -ssh root@%2 -pw %3 wifibroadcast start
)
if "%1" == "rsmaj" (
plink -ssh root@%2 -pw %3 killall -1 majestic
)
if "%1" == "binup" (
echo y | pscp -scp -pw %3 sensors/%4 root@%2:/etc/sensors/
plink -ssh root@%2 -pw %3 yaml-cli -s .isp.sensorConfig /etc/sensors/%4
)
if "%1" == "koup" (
echo y | pscp -scp -pw %3 %4 root@%2:/lib/modules/4.9.84/sigmastar/
)
if "%1" == "shup" (
echo y | pscp -scp -pw %3 *.sh root@%2:/root/
echo y | pscp -scp -pw %3 channels.sh root@%2:/usr/bin/
plink -ssh root@%2 -pw %3 rm /root/channels.sh
plink -ssh root@%2 -pw %3 chmod +x /root/*.sh
plink -ssh root@%2 -pw %3 chmod +x /usr/bin/channels.sh
)
if "%1" == "bindl" (
echo y | mkdir backup
echo y | pscp -scp -pw %3 root@%2:/etc/sensors/%4 ./backup/
)
if "%1" == "kodl" (
echo y | mkdir backup
echo y | pscp -scp -pw %3 root@%2:/lib/modules/4.9.84/sigmastar/%4 ./backup/
)
if "%1" == "shdl" (
echo y | pscp -scp -pw %3 root@%2:/usr/bin/channels.sh .
echo y | pscp -scp -pw %3 root@%2:/root/816.sh .
echo y | pscp -scp -pw %3 root@%2:/root/1080.sh .
echo y | pscp -scp -pw %3 root@%2:/root/1080b.sh .
echo y | pscp -scp -pw %3 root@%2:/root/1264.sh .
echo y | pscp -scp -pw %3 root@%2:/root/3K.sh .
echo y | pscp -scp -pw %3 root@%2:/root/4K.sh .
echo y | pscp -scp -pw %3 root@%2:/root/1184p100.sh .
echo y | pscp -scp -pw %3 root@%2:/root/1304p80.sh .
echo y | pscp -scp -pw %3 root@%2:/root/1440p60.sh .
echo y | pscp -scp -pw %3 root@%2:/root/1920p30.sh .
echo y | pscp -scp -pw %3 root@%2:/root/1080p60.sh .
echo y | pscp -scp -pw %3 root@%2:/root/720p120.sh .
echo y | pscp -scp -pw %3 root@%2:/root/720p100.sh .
echo y | pscp -scp -pw %3 root@%2:/root/720p90.sh .
echo y | pscp -scp -pw %3 root@%2:/root/720p60.sh .
echo y | pscp -scp -pw %3 root@%2:/root/1080p120.sh .
echo y | pscp -scp -pw %3 root@%2:/root/1248p90.sh .
echo y | pscp -scp -pw %3 root@%2:/root/1304p80.sh .
echo y | pscp -scp -pw %3 root@%2:/root/1416p70.sh .
echo y | pscp -scp -pw %3 root@%2:/root/kill.sh .
)
if "%1" == "temp" (
plink -ssh root@%2 -pw %3 cat /sys/devices/virtual/mstar/msys/TEMP_R
)
if "%1" == "rubyfw" (
plink -ssh root@%2 -pw %3 sed -i 's/BUILD_OPTION=fpv/BUILD_OPTION=rubyfpv/' /etc/os-release
plink -ssh root@%2 -pw %3 fw_setenv upgrade https://github.com/OpenIPC/firmware/releases/download/latest/openipc.ssc338q-nor-rubyfpv.tgz
)
if "%1" == "wfbfw" (
plink -ssh root@%2 -pw %3 sed -i 's/BUILD_OPTION=rubyfpv/BUILD_OPTION=fpv/' /etc/os-release
plink -ssh root@%2 -pw %3 fw_setenv upgrade https://github.com/OpenIPC/firmware/releases/download/latest/ssc338q_fpv_openipc-urllc-aio-nor.tgz
)
if "%1" == "offlinefw" (
echo y | pscp -scp -pw %3 %4.tgz root@%2:/tmp
plink -ssh root@%2 -pw %3 gzip -d /tmp/%4.tgz
plink -ssh root@%2 -pw %3 tar -xvf /tmp/%4.tar -C /tmp
plink -ssh root@%2 -pw %3 sysupgrade --kernel=/tmp/uImage.%5 --rootfs=/tmp/rootfs.squashfs.%5 -n
)
if "%1" == "msp" (
plink -ssh root@%2 -pw %3 killall -q msposd
echo y | pscp -scp -pw %3 msposd root@%2:/usr/bin/
echo y | pscp -scp -pw %3 bf/font.png root@%2:/usr/share/fonts/
echo y | pscp -scp -pw %3 bf/font_hd.png root@%2:/usr/share/fonts/
echo y | pscp -scp -pw %3 vtxmenu.ini root@%2:/etc/
plink -ssh root@%2 -pw %3 dos2unix /etc/vtxmenu.ini
plink -ssh root@%2 -pw %3 chmod +x /usr/bin/msposd
plink -ssh root@%2 -pw %3 sed -i '/router=/c\router=2' /etc/telemetry.conf
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "mspgs" (
plink -ssh root@%2 -pw %3 sed -i '/pixelpilot --osd --screen-mode $SCREEN_MODE --dvr-framerate $REC_FPS --dvr-fmp4 --dvr record_${current_date}.mp4/c\pixelpilot --osd --osd-elements video,wfbng --screen-mode $SCREEN_MODE --dvr-framerate $REC_FPS --dvr-fmp4 --dvr record_${current_date}.mp4 "&"' /config/scripts/stream.sh
plink -ssh root@%2 -pw %3 sed -i '/pixelpilot --osd --screen-mode $SCREEN_MODE/c\pixelpilot --osd --osd-elements video,wfbng --screen-mode $SCREEN_MODE "&"' /config/scripts/stream.sh
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "dualosd" (
plink -ssh root@%2 -pw %3 sed -i '/telemetry=false/c\telemetry=true' /etc/datalink.conf
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "onboardrecon" (
plink -ssh root@%2 -pw %3 yaml-cli -s .records.enabled true
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "onboardrecoff" (
plink -ssh root@%2 -pw %3 yaml-cli -s .records.enabled false
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "mavgs" (
plink -ssh root@%2 -pw %3 sed -i '/pixelpilot --osd --osd-elements video,wfbng --screen-mode $SCREEN_MODE --dvr-framerate $REC_FPS --dvr-fmp4 --dvr record_${current_date}.mp4 "&"/c\pixelpilot --osd --screen-mode $SCREEN_MODE --dvr-framerate $REC_FPS --dvr-fmp4 --dvr record_${current_date}.mp4 --osd-telem-lvl 2 "&"' /config/scripts/stream.sh
plink -ssh root@%2 -pw %3 sed -i '/pixelpilot --osd --osd-elements video,wfbng --screen-mode $SCREEN_MODE "&"/c\pixelpilot --osd --screen-mode $SCREEN_MODE --osd-telem-lvl 2 "&"' /config/scripts/stream.sh
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "mavgs2" (
plink -ssh root@%2 -pw %3 sed -i '/pixelpilot --osd --osd-elements video,wfbng --screen-mode $SCREEN_MODE --dvr-framerate $REC_FPS --dvr-fmp4 --dvr record_${current_date}.mp4 "&"/c\pixelpilot --osd --screen-mode $SCREEN_MODE --dvr-framerate $REC_FPS --dvr-fmp4 --dvr record_${current_date}.mp4 --osd-telem-lvl 1 "&"' /config/scripts/stream.sh
plink -ssh root@%2 -pw %3 sed -i '/pixelpilot --osd --osd-elements video,wfbng --screen-mode $SCREEN_MODE "&"/c\pixelpilot --osd --screen-mode $SCREEN_MODE --osd-telem-lvl 1 "&"' /config/scripts/stream.sh
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "resetradxa" (
plink -ssh root@%2 -pw %3 apt install dos2unix
echo y | pscp -scp -pw %3 reset/wifibroadcast.cfg root@%2:/etc
echo y | pscp -scp -pw %3 reset/wfb.conf root@%2:/etc/modprobe.d/
echo y | pscp -scp -pw %3 reset/screen-mode root@%2:/home/radxa/scripts/
echo y | pscp -scp -pw %3 reset/wifibroadcast root@%2:/etc/default/
echo y | pscp -scp -pw %3 reset/screen-mode root@%2:/config/scripts/
plink -ssh root@%2 -pw %3 dos2unix /etc/wifibroadcast.cfg /etc/modprobe.d/wfb.conf /etc/default/wifibroadcast /config/scripts/screen-mode
plink -ssh root@%2 -pw %3 reboot
)
if "%1" == "resetcam" (
plink -ssh root@%2 -pw %3 firstboot
)
if "%1" == "addbuttons" (
plink -ssh root@%2 -pw %3 apt install dos2unix
echo y | pscp -scp -pw %3 stream.sh root@%2:/config/scripts/
plink -ssh root@%2 -pw %3 dos2unix /config/scripts/stream.sh
)
if "%1" == "fontsINAV" (
echo y | pscp -scp -pw %3 inav/font.png root@%2:/usr/share/fonts/
echo y | pscp -scp -pw %3 inav/font_hd.png root@%2:/usr/share/fonts/
)
:end
echo.
pause