-
-
Notifications
You must be signed in to change notification settings - Fork 495
/
dietpi-survey_report
executable file
·1492 lines (1361 loc) · 55.1 KB
/
dietpi-survey_report
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
shopt -s extglob
{
# Created by MichaIng / [email protected] / dietpi.com
# Prevent concurrent executions
(( $(pgrep -cf 'dietpi-survey_report') > 1 )) && { echo 'Concurrent execution detected. Exiting...'; exit 1; }
#-----------------------------------------------------------
# Globals - benchmarks
#-----------------------------------------------------------
# NB: PLEASE ENSURE HW_MODEL INDEX ENTRIES MATCH : PREP, dietpi-obtain_hw_model, dietpi-survey_results,
# NBB: DO NOT REORDER INDEX's. These are now fixed and will never change (due to survey results etc)
aHW_NAME=(
[0]='Raspberry Pi 1 256M'
[1]='Raspberry Pi 1/Zero 512M'
[2]='Raspberry Pi 2'
[3]='Raspberry Pi 3/3+/Zero 2'
[4]='Raspberry Pi 4'
[5]='Raspberry Pi 5'
[10]='Odroid C1'
[11]='Odroid XU3/XU4/MC1/HC1/HC2'
[12]='Odroid C2'
[13]='Odroid U3'
[15]='Odroid N2'
[16]='Odroid C4/HC4'
[20]='x86_64 VM'
[21]='x86_64 PC'
[22]='Generic Device'
[23]='Generic Rockchip RK3328'
[24]='Generic Rockchip RK3399'
[25]='Generic Allwinner H3'
[26]='Generic Allwinner H5'
[27]='Generic Allwinner H6'
[28]='Generic Amlogic S905'
[29]='Generic Amlogic S922X'
[30]='OrangePi PC'
[31]='OrangePi One'
[32]='OrangePi Zero (H2+)'
[33]='OrangePi Lite'
[34]='OrangePi Plus'
[35]='OrangePi Zero Plus 2 (H3/H5)'
[36]='OrangePi Win'
[37]='OrangePi Prime'
[38]='OrangePi PC 2'
[39]='LeMaker Guitar'
[40]='PINE A64'
[41]='OrangePi PC Plus'
[42]='ROCKPro64'
[43]='ROCK64'
[44]='Pinebook'
[45]='PINE H64'
[46]='Pinebook Pro'
[47]='NanoPi R4S'
[48]='NanoPi R1'
[49]='Quartz64'
[50]='BananaPi M2+ (sinovoip)'
[51]='BananaPi Pro (Lemaker)'
[52]='ASUS Tinker Board'
[53]='BananaPi (sinovoip)'
[54]='NanoPi K2'
[55]='NanoPi R2S'
[56]='NanoPi NEO3'
[57]='NanoPi NEO Plus2'
[58]='NanoPi M4V2'
[59]='ZeroPi'
[60]='NanoPi NEO'
[61]='NanoPi M2/T2'
[62]='NanoPi M3/T3/Fire3'
[63]='NanoPi M1'
[64]='NanoPi NEO Air'
[65]='NanoPi NEO2'
[66]='NanoPi M1 Plus'
[67]='NanoPi K1 Plus'
[68]='NanoPi M4/T4/NEO4'
[69]='Firefly RK3399'
[70]='Sparky SBC'
[71]='BeagleBone Black'
[72]='ROCK 4'
[73]='ROCK Pi S'
[74]='Radxa Zero'
[75]='Container'
[76]='NanoPi R5S/R5C'
[77]='ROCK 3A'
[78]='ROCK 5B'
[79]='NanoPi 6 series'
[80]='Orange Pi 5'
[81]='StarFive VisionFive 2'
[82]='Orange Pi 5 Plus'
[83]='Orange Pi Zero 3'
[84]='Star64'
[85]='ROCK 5A'
[86]='ASUS Tinker Board 2'
[87]='Orange Pi 3B'
[88]='Orange Pi Zero 2W'
[89]='Orange Pi 3 LTS'
[90]='Radxa ZERO 3'
[91]='Orange Pi 5 Max'
[92]='NanoPi M6'
)
## Benchmark data arrays: aBENCH_XX[$HW_MODEL,${aBENCH_XX_INDEX[$HW_MODEL]}]
# Core benchmarks
# - CPU time in x.xx seconds
aBENCH_CPU_INDEX=()
declare -A aBENCH_CPU
# - CPU temp in integer °C
aBENCH_CPU_TEMP_INDEX=()
declare -A aBENCH_CPU_TEMP_START
declare -A aBENCH_CPU_TEMP_END
# - I/O in integer MiB/s
aBENCH_RAM_INDEX=()
declare -A aBENCH_RAM_WRITE
declare -A aBENCH_RAM_READ
aBENCH_ROOTFS_INDEX=()
declare -A aBENCH_ROOTFS_WRITE
declare -A aBENCH_ROOTFS_READ
# Optional benchmarks
aBENCH_CUSTOMFS_INDEX=()
declare -A aBENCH_CUSTOMFS_WRITE
declare -A aBENCH_CUSTOMFS_READ
aBENCH_LAN_INDEX=()
declare -A aBENCH_NET_LAN_SPEED
# Benchmark result arrays: min, max, average
aBENCH_RESULT_CPU_MIN=()
aBENCH_RESULT_CPU_MAX=()
aBENCH_RESULT_CPU_AVG=()
aBENCH_RESULT_CPU_TEMP_START_MIN=()
aBENCH_RESULT_CPU_TEMP_START_MAX=()
aBENCH_RESULT_CPU_TEMP_START_AVG=()
aBENCH_RESULT_CPU_TEMP_END_MIN=()
aBENCH_RESULT_CPU_TEMP_END_MAX=()
aBENCH_RESULT_CPU_TEMP_END_AVG=()
aBENCH_RESULT_RAM_READ_MIN=()
aBENCH_RESULT_RAM_READ_MAX=()
aBENCH_RESULT_RAM_READ_AVG=()
aBENCH_RESULT_RAM_WRITE_MIN=()
aBENCH_RESULT_RAM_WRITE_MAX=()
aBENCH_RESULT_RAM_WRITE_AVG=()
aBENCH_RESULT_ROOTFS_READ_MIN=()
aBENCH_RESULT_ROOTFS_READ_MAX=()
aBENCH_RESULT_ROOTFS_READ_AVG=()
aBENCH_RESULT_ROOTFS_WRITE_MIN=()
aBENCH_RESULT_ROOTFS_WRITE_MAX=()
aBENCH_RESULT_ROOTFS_WRITE_AVG=()
aBENCH_RESULT_CUSTOMFS_READ_MIN=()
aBENCH_RESULT_CUSTOMFS_READ_MAX=()
aBENCH_RESULT_CUSTOMFS_READ_AVG=()
aBENCH_RESULT_CUSTOMFS_WRITE_MIN=()
aBENCH_RESULT_CUSTOMFS_WRITE_MAX=()
aBENCH_RESULT_CUSTOMFS_WRITE_AVG=()
aBENCH_RESULT_NET_LAN_SPEED_MIN=()
aBENCH_RESULT_NET_LAN_SPEED_MAX=()
aBENCH_RESULT_NET_LAN_SPEED_AVG=()
#-----------------------------------------------------------
# Globals - Survey
#-----------------------------------------------------------
DATE_NOW=
SURVEY_COUNT_TOTAL=0
SURVEY_COUNT_OPTIN=0
SURVEY_COUNT_OPTOUT=0
SURVEY_COUNT_INACTIVE=0
SURVEY_COUNT_REACTIVE=0
declare -A aDIETPI_VERSION
declare -A aDEVICE_NAME
declare -A aCPU_ARCH
aCPU_COUNT=()
declare -A aDISTRO_VERSION
declare -A aAUTOSTART_OPTION
declare -A aSOFTWARE
aAUTO_SETUP_AUTOMATED=(0 0)
declare -A aNETWORK_INTERFACE
# v6.17 addition
declare -A aGIT_BRANCH
# v6.31 addition
aRASPBIAN=(0 0)
# v8.0 addition
aMMC=(0 0)
# Convert autostart index to name array
# shellcheck disable=SC2034
aAUTOSTART_NAME=(
[0]='Console manual login'
[1]='Kodi'
[2]='Desktop auto login'
[3]='RetroPie'
[4]='OpenTyrian'
[5]='DietPi-CloudShell'
[6]='Amiberry fast boot'
[7]='Console auto login'
[8]='Amiberry standard boot'
[9]='DXX-Rebirth'
[10]='CAVA Spectrum'
[11]='Chromium'
[14]='Custom (background)'
[15]='JRiver'
[16]='Desktop LightDM login'
[17]='Custom (foreground)'
)
# Convert software index to title array
aSOFTWARE_NAME=(
[0]='OpenSSH Client'
[1]='Samba Client'
[2]='Folding@Home'
[3]='MC'
[4]='ViFM'
[5]='ALSA'
[6]='X.Org X Server'
[7]='FFmpeg'
[8]='Java JDK'
[9]='Node.js'
[10]='iftop'
[11]='IPTraf'
[12]='Iperf'
[13]='MTR-Tiny'
[14]='nLoad'
[15]='tcpdump'
[16]='Build-Essential'
[17]='Git Client'
[18]='Emacs'
[19]='Jed'
[20]='Vim'
[21]='Vim-Tiny'
[22]='QuiteRSS'
[23]='LXDE'
[24]='MATE'
[25]='Xfce'
[26]='GNUstep'
[27]='TightVNC Server'
[28]='TigerVNC Server'
[29]='XRDP'
[30]='NoMachine'
[31]='Kodi'
[32]='ympd'
[33]='Airsonic-Advanced'
[34]='Subsonic'
[35]='Logitech Media Server'
[36]='Squeezelite'
[37]='Shairport Sync'
[38]='FreshRSS'
[39]='ReadyMedia'
[40]='Ampache'
[41]='Emby Server'
[42]='Plex Media Server'
[43]='Murmur'
[44]='Transmission'
[45]='Deluge'
[46]='qBittorrent'
[47]='ownCloud'
[48]='Pydio'
[49]='Gogs'
[50]='Syncthing'
[51]='OpenTyrian'
[52]='Cuberite'
[53]='MineOS'
[54]='phpBB'
[55]='WordPress'
[56]='Single File PHP Gallery'
[57]='Baïkal'
[58]='OpenBazaar'
[59]='RPi Cam Web Interface'
[60]='WiFi Hotspot'
[61]='Tor Hotspot'
[62]='DietPi-CloudShell'
[63]='LinuxDash'
[64]='phpSysInfo'
[65]='Netdata'
[66]='RPi-Monitor'
[67]='No-IP'
[68]='Remote.It'
[69]='RPi.GPIO'
[70]='WiringPi'
[71]='WebIOPi'
[72]='I2C'
[73]='Fail2Ban'
[74]='InfluxDB'
[75]='LASP'
[76]='LAMP'
[77]='Grafana'
[78]='LESP'
[79]='LEMP'
[80]='Ubooquity'
[81]='LLSP'
[82]='LLMP'
[83]='Apache'
[84]='Lighttpd'
[85]='Nginx'
[86]='Roon Extension Manager'
[87]='SQLite'
[88]='MariaDB'
[89]='PHP'
[90]='phpMyAdmin'
[91]='Redis'
[92]='Certbot'
[93]='Pi-hole'
[94]='ProFTPD'
[95]='vsftpd'
[96]='Samba Server'
[97]='OpenVPN'
[98]='HAProxy'
[99]='emonHub'
[100]='PiJuice'
[101]='Logrotate'
[102]='Rsyslog'
[103]='DietPi-RAMlog'
[104]='Dropbear'
[105]='OpenSSH Server'
[106]='Lidarr'
[107]='rTorrent'
[108]='Amiberry'
[109]='NFS Server'
[110]='NFS Client'
[111]='UrBackup Server'
[112]='DXX-Rebirth'
[113]='Chromium'
[114]='Nextcloud'
[115]='Webmin'
[116]='SickRage'
[117]='PiVPN'
[118]='Mopidy'
[119]='CAVA'
[120]='RealVNC Server'
[121]='Roon Bridge'
[122]='Node-RED'
[123]='Mosquitto'
[124]='NAA daemon'
[125]='Tomcat 8'
[126]='LibSSL1.0.0'
[127]='NeoVim'
[128]='MPD'
[129]='O!MPD'
[130]='Python pip'
[131]='Blynk Server'
[132]='Aria2'
[133]='YaCy'
[134]='Tonido'
[135]='IceCast'
[136]='motionEye'
[137]='CloudPrint'
[138]='VirtualHere'
[139]='SABnzbd'
[140]='SDL2'
[141]='Spotify Connect Web'
[142]='CouchPotato'
[143]='Koel'
[144]='Sonarr'
[145]='Radarr'
[146]='Tautulli'
[147]='Jackett'
#[148]=
[149]='NZBGet'
[150]='Mono'
[151]='Nvidia'
[152]='Avahi-Daemon'
[153]='OctoPrint'
[154]='Roon Server'
[155]='HTPC Manager'
[156]='Steam'
[157]='Home Assistant'
[158]='MinIO'
[159]='Allo'
[160]='Allo_update'
[161]='FuguHub'
[162]='Docker'
[163]='GMediaRender'
[164]='Nukkit'
[165]='Gitea'
[166]='PI-SPC'
[167]='Raspotify'
#[168]=
[169]='Google AIY'
)
aSOFTWARE_NAME6_14=()
aSOFTWARE_NAME6_15=()
for i in "${!aSOFTWARE_NAME[@]}"
do
aSOFTWARE_NAME6_14[i]=${aSOFTWARE_NAME[i]}
aSOFTWARE_NAME6_15[i]=${aSOFTWARE_NAME6_14[i]}
done
aSOFTWARE_NAME6_15[148]='myMPD'
aSOFTWARE_NAME6_16=()
aSOFTWARE_NAME6_17=()
aSOFTWARE_NAME6_18=()
for i in "${!aSOFTWARE_NAME6_15[@]}"
do
aSOFTWARE_NAME6_16[i]=${aSOFTWARE_NAME6_15[i]}
aSOFTWARE_NAME6_17[i]=${aSOFTWARE_NAME6_16[i]}
aSOFTWARE_NAME6_18[i]=${aSOFTWARE_NAME6_17[i]}
done
aSOFTWARE_NAME6_18[168]='Nextcloud Talk'
aSOFTWARE_NAME6_19=()
aSOFTWARE_NAME6_20=()
for i in "${!aSOFTWARE_NAME6_18[@]}"
do
aSOFTWARE_NAME6_19[i]=${aSOFTWARE_NAME6_18[i]}
aSOFTWARE_NAME6_20[i]=${aSOFTWARE_NAME6_19[i]}
done
aSOFTWARE_NAME6_20[116]='Medusa'
aSOFTWARE_NAME6_20[170]='UnRAR'
aSOFTWARE_NAME6_20[171]='DietPi-NordVPN'
aSOFTWARE_NAME6_20[172]='WireGuard'
aSOFTWARE_NAME6_21=()
aSOFTWARE_NAME6_22=()
aSOFTWARE_NAME6_23=()
for i in "${!aSOFTWARE_NAME6_20[@]}"
do
aSOFTWARE_NAME6_21[i]=${aSOFTWARE_NAME6_20[i]}
aSOFTWARE_NAME6_22[i]=${aSOFTWARE_NAME6_21[i]}
aSOFTWARE_NAME6_23[i]=${aSOFTWARE_NAME6_22[i]}
done
aSOFTWARE_NAME6_23[173]='LXQt'
aSOFTWARE_NAME6_23[174]='GIMP'
aSOFTWARE_NAME6_23[175]='Xfce Power Manager'
aSOFTWARE_NAME6_24=()
aSOFTWARE_NAME6_25=()
for i in "${!aSOFTWARE_NAME6_23[@]}"
do
aSOFTWARE_NAME6_24[i]=${aSOFTWARE_NAME6_23[i]}
aSOFTWARE_NAME6_25[i]=${aSOFTWARE_NAME6_24[i]}
done
aSOFTWARE_NAME6_25[176]='Mycroft AI'
aSOFTWARE_NAME6_26=()
for i in "${!aSOFTWARE_NAME6_25[@]}"
do
aSOFTWARE_NAME6_26[i]=${aSOFTWARE_NAME6_25[i]}
done
unset -v 'aSOFTWARE_NAME6_26[27]' # TightVNC: Replaced by TigerVNC on Stretch+
unset -v 'aSOFTWARE_NAME6_26[140]' # SDL2: Merged into Amiberry for targeted minimal install
aSOFTWARE_NAME6_27=()
for i in "${!aSOFTWARE_NAME6_26[@]}"
do
aSOFTWARE_NAME6_27[i]=${aSOFTWARE_NAME6_26[i]}
done
aSOFTWARE_NAME6_27[27]='TasmoAdmin'
aSOFTWARE_NAME6_28=()
aSOFTWARE_NAME6_29=()
for i in "${!aSOFTWARE_NAME6_27[@]}"
do
aSOFTWARE_NAME6_28[i]=${aSOFTWARE_NAME6_27[i]}
aSOFTWARE_NAME6_29[i]=${aSOFTWARE_NAME6_28[i]}
done
aSOFTWARE_NAME6_29[140]='Domoticz'
aSOFTWARE_NAME6_30=()
aSOFTWARE_NAME6_31=()
for i in "${!aSOFTWARE_NAME6_29[@]}"
do
aSOFTWARE_NAME6_30[i]=${aSOFTWARE_NAME6_29[i]}
aSOFTWARE_NAME6_31[i]=${aSOFTWARE_NAME6_30[i]}
done
aSOFTWARE_NAME6_31[177]='Firefox Sync Server'
aSOFTWARE_NAME6_32=()
for i in "${!aSOFTWARE_NAME6_31[@]}"
do
aSOFTWARE_NAME6_32[i]=${aSOFTWARE_NAME6_31[i]}
done
aSOFTWARE_NAME6_32[178]='Jellyfin'
aSOFTWARE_NAME6_32[179]='Komga'
aSOFTWARE_NAME6_33=()
for i in "${!aSOFTWARE_NAME6_32[@]}"
do
aSOFTWARE_NAME6_33[i]=${aSOFTWARE_NAME6_32[i]}
done
aSOFTWARE_NAME6_33[180]='Bazarr'
aSOFTWARE_NAME6_34=()
for i in "${!aSOFTWARE_NAME6_33[@]}"
do
aSOFTWARE_NAME6_34[i]=${aSOFTWARE_NAME6_33[i]}
done
unset -v 'aSOFTWARE_NAME6_34[62]' # DietPi-CloudShell
unset -v 'aSOFTWARE_NAME6_34[134]' # Tonido
unset -v 'aSOFTWARE_NAME6_34[137]' # CloudPrint
aSOFTWARE_NAME6_34[181]='PaperMC'
aSOFTWARE_NAME6_34[182]='Unbound'
aSOFTWARE_NAME6_34[183]='vaultwarden'
aSOFTWARE_NAME6_34[184]='Tor Relay'
aSOFTWARE_NAME6_34[185]='Portainer'
# v6.35
aSOFTWARE_NAME6_35=()
for i in "${!aSOFTWARE_NAME6_34[@]}"
do
aSOFTWARE_NAME6_35[i]=${aSOFTWARE_NAME6_34[i]}
done
aSOFTWARE_NAME6_35[62]='Box86'
aSOFTWARE_NAME6_35[134]='Docker Compose'
aSOFTWARE_NAME6_35[137]='mjpg-streamer'
aSOFTWARE_NAME7_0=()
aSOFTWARE_NAME7_1=()
for i in "${!aSOFTWARE_NAME6_35[@]}"
do
aSOFTWARE_NAME7_0[i]=${aSOFTWARE_NAME6_35[i]}
aSOFTWARE_NAME7_1[i]=${aSOFTWARE_NAME7_0[i]}
done
aSOFTWARE_NAME7_1[186]='IPFS Node'
aSOFTWARE_NAME7_1[187]='CUPS'
aSOFTWARE_NAME7_1[188]='Go'
aSOFTWARE_NAME7_1[189]='VSCodium'
unset -v 'aSOFTWARE_NAME7_1[67]' # No-IP: Replaced with DietPi-DDNS
unset -v 'aSOFTWARE_NAME7_1[171]' # DietPi-NordVPN: Replaced with DietPi-VPN
aSOFTWARE_NAME7_2=()
for i in "${!aSOFTWARE_NAME7_1[@]}"
do
aSOFTWARE_NAME7_2[i]=${aSOFTWARE_NAME7_1[i]}
done
aSOFTWARE_NAME7_2[67]='Firefox'
unset -v 'aSOFTWARE_NAME7_2[126]' # LibSSL1.0.0
aSOFTWARE_NAME7_3=()
for i in "${!aSOFTWARE_NAME7_2[@]}"
do
aSOFTWARE_NAME7_3[i]=${aSOFTWARE_NAME7_2[i]}
done
aSOFTWARE_NAME7_3[126]='AdGuard Home'
aSOFTWARE_NAME7_3[171]='frp'
aSOFTWARE_NAME7_3[190]='Beets'
aSOFTWARE_NAME7_3[191]='Snapcast Server'
aSOFTWARE_NAME7_3[192]='Snapcast Client'
aSOFTWARE_NAME7_3[193]='K3s'
unset -v 'aSOFTWARE_NAME7_3[125]' # Tomcat 8
aSOFTWARE_NAME7_4=()
for i in "${!aSOFTWARE_NAME7_3[@]}"
do
aSOFTWARE_NAME7_4[i]=${aSOFTWARE_NAME7_3[i]}
done
aSOFTWARE_NAME7_4[125]='Synapse Server'
aSOFTWARE_NAME7_4[194]='PostgreSQL'
aSOFTWARE_NAME7_4[195]='youtube-dl'
aSOFTWARE_NAME7_5=()
for i in "${!aSOFTWARE_NAME7_4[@]}"
do
aSOFTWARE_NAME7_5[i]=${aSOFTWARE_NAME7_4[i]}
done
aSOFTWARE_NAME7_5[196]='Java JRE'
aSOFTWARE_NAME7_6=()
for i in "${!aSOFTWARE_NAME7_5[@]}"
do
aSOFTWARE_NAME7_6[i]=${aSOFTWARE_NAME7_5[i]}
done
aSOFTWARE_NAME7_6[197]='Box64'
aSOFTWARE_NAME7_6[198]='File Browser'
aSOFTWARE_NAME7_6[199]='Spotifyd'
aSOFTWARE_NAME7_7=()
for i in "${!aSOFTWARE_NAME7_6[@]}"
do
aSOFTWARE_NAME7_7[i]=${aSOFTWARE_NAME7_6[i]}
done
unset -v 'aSOFTWARE_NAME7_7[142]' # CouchPotato
aSOFTWARE_NAME7_8=()
for i in "${!aSOFTWARE_NAME7_7[@]}"
do
aSOFTWARE_NAME7_8[i]=${aSOFTWARE_NAME7_7[i]}
done
unset -v 'aSOFTWARE_NAME7_8[34]' # Subsonic
unset -v 'aSOFTWARE_NAME7_8[99]' # emonHub
aSOFTWARE_NAME7_8[200]='DietPi-Dashboard'
aSOFTWARE_NAME7_9=()
aSOFTWARE_NAME8_0=()
aSOFTWARE_NAME8_1=()
aSOFTWARE_NAME8_2=()
for i in "${!aSOFTWARE_NAME7_8[@]}"
do
aSOFTWARE_NAME7_9[i]=${aSOFTWARE_NAME7_8[i]}
aSOFTWARE_NAME8_0[i]=${aSOFTWARE_NAME7_9[i]}
aSOFTWARE_NAME8_1[i]=${aSOFTWARE_NAME8_0[i]}
aSOFTWARE_NAME8_2[i]=${aSOFTWARE_NAME8_1[i]}
done
aSOFTWARE_NAME8_2[142]='MicroK8s'
unset -v 'aSOFTWARE_NAME8_2[151]' # Nvidia
aSOFTWARE_NAME8_3=()
for i in "${!aSOFTWARE_NAME8_2[@]}"
do
aSOFTWARE_NAME8_3[i]=${aSOFTWARE_NAME8_2[i]}
done
aSOFTWARE_NAME8_3[34]='PHP Composer'
aSOFTWARE_NAME8_4=()
for i in "${!aSOFTWARE_NAME8_3[@]}"
do
aSOFTWARE_NAME8_4[i]=${aSOFTWARE_NAME8_3[i]}
done
unset -v 'aSOFTWARE_NAME8_4[58]' # OpenBazaar
aSOFTWARE_NAME8_5=()
for i in "${!aSOFTWARE_NAME8_4[@]}"
do
aSOFTWARE_NAME8_5[i]=${aSOFTWARE_NAME8_4[i]}
done
aSOFTWARE_NAME8_5[151]='Prowlarr'
aSOFTWARE_NAME8_6=()
for i in "${!aSOFTWARE_NAME8_5[@]}"
do
aSOFTWARE_NAME8_6[i]=${aSOFTWARE_NAME8_5[i]}
done
aSOFTWARE_NAME8_6[58]='Tailscale'
aSOFTWARE_NAME8_6[99]='Prometheus Node Exporter'
aSOFTWARE_NAME8_6[201]='ZeroTier'
aSOFTWARE_NAME8_6[202]='Rclone'
aSOFTWARE_NAME8_7=()
for i in "${!aSOFTWARE_NAME8_6[@]}"
do
aSOFTWARE_NAME8_7[i]=${aSOFTWARE_NAME8_6[i]}
done
aSOFTWARE_NAME8_7[203]='Readarr'
aSOFTWARE_NAME8_7[204]='Navidrome'
aSOFTWARE_NAME8_8=()
aSOFTWARE_NAME8_9=()
aSOFTWARE_NAME8_10=()
aSOFTWARE_NAME8_11=()
for i in "${!aSOFTWARE_NAME8_7[@]}"
do
aSOFTWARE_NAME8_8[i]=${aSOFTWARE_NAME8_7[i]}
aSOFTWARE_NAME8_9[i]=${aSOFTWARE_NAME8_8[i]}
aSOFTWARE_NAME8_10[i]=${aSOFTWARE_NAME8_9[i]}
aSOFTWARE_NAME8_11[i]=${aSOFTWARE_NAME8_10[i]}
done
aSOFTWARE_NAME8_11[205]='Homer'
aSOFTWARE_NAME8_12=()
aSOFTWARE_NAME8_13=()
aSOFTWARE_NAME8_14=()
aSOFTWARE_NAME8_15=()
for i in "${!aSOFTWARE_NAME8_11[@]}"
do
aSOFTWARE_NAME8_12[i]=${aSOFTWARE_NAME8_11[i]}
aSOFTWARE_NAME8_13[i]=${aSOFTWARE_NAME8_12[i]}
aSOFTWARE_NAME8_14[i]=${aSOFTWARE_NAME8_13[i]}
aSOFTWARE_NAME8_15[i]=${aSOFTWARE_NAME8_14[i]}
done
unset -v 'aSOFTWARE_NAME8_15[16]' # Build-Essential
aSOFTWARE_NAME8_16=()
for i in "${!aSOFTWARE_NAME8_15[@]}"
do
aSOFTWARE_NAME8_16[i]=${aSOFTWARE_NAME8_15[i]}
done
aSOFTWARE_NAME8_16[16]='microblog.pub'
aSOFTWARE_NAME8_17=()
for i in "${!aSOFTWARE_NAME8_16[@]}"
do
aSOFTWARE_NAME8_17[i]=${aSOFTWARE_NAME8_16[i]}
done
aSOFTWARE_NAME8_17[206]='openHAB'
aSOFTWARE_NAME8_17[207]='Moonlight (CLI)'
aSOFTWARE_NAME8_17[208]='Moonlight (GUI)'
aSOFTWARE_NAME8_17[209]='Restic'
aSOFTWARE_NAME8_18=()
aSOFTWARE_NAME8_19=()
for i in "${!aSOFTWARE_NAME8_17[@]}"
do
aSOFTWARE_NAME8_18[i]=${aSOFTWARE_NAME8_17[i]}
aSOFTWARE_NAME8_19[i]=${aSOFTWARE_NAME8_18[i]}
done
unset -v 'aSOFTWARE_NAME8_19[141]' # Spotify Connect Web
unset -v 'aSOFTWARE_NAME8_19[177]' # Firefox Sync Server
aSOFTWARE_NAME8_19[210]='MediaWiki'
aSOFTWARE_NAME8_20=()
for i in "${!aSOFTWARE_NAME8_19[@]}"
do
aSOFTWARE_NAME8_20[i]=${aSOFTWARE_NAME8_19[i]}
done
aSOFTWARE_NAME8_20[211]='Homebridge'
aSOFTWARE_NAME8_21=()
aSOFTWARE_NAME8_22=()
for i in "${!aSOFTWARE_NAME8_20[@]}"
do
aSOFTWARE_NAME8_21[i]=${aSOFTWARE_NAME8_20[i]}
aSOFTWARE_NAME8_22[i]=${aSOFTWARE_NAME8_21[i]}
done
aSOFTWARE_NAME8_22[141]='ADS-B Feeder'
aSOFTWARE_NAME8_22[212]='Kavita'
aSOFTWARE_NAME8_23=()
aSOFTWARE_NAME8_24=()
aSOFTWARE_NAME8_25=()
aSOFTWARE_NAME9_0=()
aSOFTWARE_NAME9_1=()
aSOFTWARE_NAME9_2=()
for i in "${!aSOFTWARE_NAME8_22[@]}"
do
aSOFTWARE_NAME8_23[i]=${aSOFTWARE_NAME8_22[i]}
aSOFTWARE_NAME8_24[i]=${aSOFTWARE_NAME8_23[i]}
aSOFTWARE_NAME8_25[i]=${aSOFTWARE_NAME8_24[i]}
aSOFTWARE_NAME9_0[i]=${aSOFTWARE_NAME8_25[i]}
aSOFTWARE_NAME9_1[i]=${aSOFTWARE_NAME9_0[i]}
aSOFTWARE_NAME9_2[i]=${aSOFTWARE_NAME9_1[i]}
aSOFTWARE_NAME9_3[i]=${aSOFTWARE_NAME9_2[i]}
aSOFTWARE_NAME9_4[i]=${aSOFTWARE_NAME9_3[i]}
aSOFTWARE_NAME9_5[i]=${aSOFTWARE_NAME9_4[i]}
done
aSOFTWARE_NAME9_5[177]='Forgejo'
aSOFTWARE_NAME9_6=()
for i in "${!aSOFTWARE_NAME9_5[@]}"
do
aSOFTWARE_NAME9_6[i]=${aSOFTWARE_NAME9_5[i]}
done
aSOFTWARE_NAME9_6[213]='soju'
aSOFTWARE_NAME9_7=()
aSOFTWARE_NAME9_8=()
for i in "${!aSOFTWARE_NAME9_6[@]}"
do
aSOFTWARE_NAME9_7[i]=${aSOFTWARE_NAME9_6[i]}
aSOFTWARE_NAME9_8[i]=${aSOFTWARE_NAME9_7[i]}
done
# Pre-create software counter array so that we can see also software (available in newest version) with 0 installs
for i in "${aSOFTWARE_NAME9_8[@]}"
do
aSOFTWARE[$i]=0
done
# $1 = File name
Process_File()
{
local file=$1 version branch device arch cpu_count distro autostart automated iface raspbian software asoftware=() mmc
local BENCH_VERSION BENCH_HW_MODEL BENCH_CPU BENCH_ROOTFS_WRITE BENCH_ROOTFS_READ BENCH_RAM_WRITE BENCH_RAM_READ BENCH_CUSTOMFS_WRITE BENCH_CUSTOMFS_READ BENCH_CPU_TEMP_START BENCH_CPU_TEMP_END BENCH_NET_LAN_SPEED
while read -r line
do
# shellcheck disable=SC2016
case "$line" in
'#'*) :;; # Pre-v7.1
'((aSURVEY_VERSION[6]++))') :;; # Pre-v6.22
'((aSURVEY_SENTCOUNT['+([[:digit:]])']++))') :;; # Pre-v6.22
'((aDIETPI_VERSION['+([[:digit:]]).+([[:digit:]])']++))') version=${line#*'['} version=${version%']'*};;
'((aGIT_BRANCH['+([[:graph:]])']++))') branch=${line#*'['} branch=${branch%']'*};; # since v6.17
'((aDEVICE_NAME['+([[:print:]])']++))') device=${line#*'['} device=${device%']'*};;
'((aCPU_ARCH['+([[:graph:]])']++))') arch=${line#*'['} arch=${arch%']'*};;
'((aCPU_COUNT['+([[:digit:]])']++))') cpu_count=${line#*'['} cpu_count=${cpu_count%']'*};;
'((aDISTRO_VERSION['+([[:alpha:]])']++))') distro=${line#*'['} distro=${distro%']'*};;
'((aAUTOSTART_OPTION[${aAUTOSTART_NAME['+([[:digit:]])']:='+([[:digit:]])'}]++))') autostart=${line##*'['} autostart=${autostart%%']'*};;
'((aAUTOSTART_OPTION[${aAUTOSTART_NAME['+([[:digit:]])']}]++))') autostart=${line##*'['} autostart=${autostart%%']'*};; # Pre-v6.17
'((aAUTO_SETUP_AUTOMATED['[01]']++))') automated=${line#*'['} automated=${automated%']'*};;
'((aNETWORK_INTERFACE['+([[:graph:]])']++))') iface=${line#*'['} iface=${iface%']'*};;
'((aRASPBIAN['[01]']++))') raspbian=${line#*'['} raspbian=${raspbian%']'*};; # since v6.31
'MMC='[01]) mmc=${line#*'='};;
'((aSOFTWARE[${aSOFTWARE_NAME'${version/./_}'['+([[:digit:]])']:='+([[:digit:]])'}]++))') software=${line##*'['} software=${software%%']'*};;
'((aSOFTWARE[${aSOFTWARE_NAME'${version/./_}'['+([[:digit:]])']}]++))') software=${line##*'['} software=${software%%']'*};; # Pre-v6.17
'BENCH_VERSION='[12]) BENCH_VERSION=${line#*'='};; # 1 until v6.23, 2 afterwards
'BENCH_HW_MODEL='+([[:digit:]])) BENCH_HW_MODEL=${line#*'='};;
'BENCH_HW_MODEL=-1') BENCH_HW_MODEL=22;; # Pre-v6.29: Migrate fallback "-1" to Generic Device
'BENCH_CPU='*) BENCH_CPU=${line#*\'} BENCH_CPU=${BENCH_CPU%\'};;
'BENCH_ROOTFS_WRITE='*) BENCH_ROOTFS_WRITE=${line#*\'} BENCH_ROOTFS_WRITE=${BENCH_ROOTFS_WRITE%\'};;
'BENCH_ROOTFS_READ='*) BENCH_ROOTFS_READ=${line#*\'} BENCH_ROOTFS_READ=${BENCH_ROOTFS_READ%\'};;
'BENCH_RAM_WRITE='*) BENCH_RAM_WRITE=${line#*\'} BENCH_RAM_WRITE=${BENCH_RAM_WRITE%\'};;
'BENCH_RAM_READ='*) BENCH_RAM_READ=${line#*\'} BENCH_RAM_READ=${BENCH_RAM_READ%\'};;
'BENCH_CUSTOMFS_WRITE='*) BENCH_CUSTOMFS_WRITE=${line#*\'} BENCH_CUSTOMFS_WRITE=${BENCH_CUSTOMFS_WRITE%\'};;
'BENCH_CUSTOMFS_READ='*) BENCH_CUSTOMFS_READ=${line#*\'} BENCH_CUSTOMFS_READ=${BENCH_CUSTOMFS_READ%\'};;
'BENCH_CPU_TEMP_START='*) BENCH_CPU_TEMP_START=${line#*\'} BENCH_CPU_TEMP_START=${BENCH_CPU_TEMP_START%\'};;
'BENCH_CPU_TEMP_END='*) BENCH_CPU_TEMP_END=${line#*\'} BENCH_CPU_TEMP_END=${BENCH_CPU_TEMP_END%\'};;
'BENCH_NET_LAN_SPEED='*) BENCH_NET_LAN_SPEED=${line#*\'} BENCH_NET_LAN_SPEED=${BENCH_NET_LAN_SPEED%\'};;
*)
echo "Invalid line: $line"
mv -v "/home/dietpi-survey/survey/$file" /home/dietpi-survey/invalid/
return 1
;;
esac
# Validate and process software name if present
[[ $software ]] || continue
eval "software=\${aSOFTWARE_NAME${version/./_}[$software]}"
if [[ ! $software ]]
then
echo "Invalid software ID \"$software\" for DietPi version $version"
mv -v "/home/dietpi-survey/survey/$file" /home/dietpi-survey/invalid/
return 1
fi
asoftware+=("$software")
unset -v software
done < "$file"
# Values that must exist
if ! [[ $version && $device && $arch && $cpu_count && $distro && $autostart && ${aAUTOSTART_NAME[$autostart]} && $automated && $iface ]]
then
echo 'Missing survey value'
mv -v "/home/dietpi-survey/survey/$file" /home/dietpi-survey/invalid/
return 1
fi
# Sort out files that are > 6 months old
(( $DATE_NOW - $(date -u '+%s' -r "$file") < 15724800 )) || { mv "/home/dietpi-survey/survey/$file" /home/dietpi-survey/old/; ((SURVEY_COUNT_INACTIVE++)); return 0; }
# Valid content
((SURVEY_COUNT_OPTIN++))
# Count re-activated systems which didn't show activity for at least 6 months but uploaded a new survey file
if [[ -f /home/dietpi-survey/old/$file ]]
then
((SURVEY_COUNT_REACTIVE++))
# Remove old file
rm "/home/dietpi-survey/old/$file"
fi
# Add to global arrays
((aDIETPI_VERSION["$version"]++))
[[ $branch ]] && ((aGIT_BRANCH["$branch"]++))
((aDEVICE_NAME["$device"]++))
((aCPU_ARCH["$arch"]++))
((aCPU_COUNT["$cpu_count"]++))
((aDISTRO_VERSION["$distro"]++))
((aAUTOSTART_OPTION[${aAUTOSTART_NAME["$autostart"]}]++))
((aAUTO_SETUP_AUTOMATED["$automated"]++))
((aNETWORK_INTERFACE["$iface"]++))
[[ $raspbian ]] && ((aRASPBIAN["$raspbian"]++))
[[ $mmc ]] && ((aMMC["$mmc"]++))
for i in "${asoftware[@]}"
do
((aSOFTWARE[$i]++))
done
# Process benchmark results if present and hardware ID valid
[[ $BENCH_VERSION && $BENCH_HW_MODEL ]] || return 0
[[ $BENCH_VERSION =~ ^[0-9]+$ ]] || { echo "Invalid DietPi-Benchmark version: $BENCH_VERSION"; return 1; }
[[ ${aHW_NAME[$BENCH_HW_MODEL]} ]] || { echo "Invalid hardware ID: $BENCH_HW_MODEL"; return 1; }
# CPU
if [[ $BENCH_CPU == *[1-9]* && $BENCH_CPU =~ ^[0-9]+\.[0-9]{2}$ ]]
then
# CPU time: Remove decimal point, equals times 100 since it's always in x.xx
BENCH_CPU=${BENCH_CPU/.}
# - Remove leading zeros to support machines with <1s CPU time: One case with 0.94s was just spotted.
while [[ $BENCH_CPU == 0* ]]; do BENCH_CPU=${BENCH_CPU#0}; done
aBENCH_CPU[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CPU
# CPU temps: Patch for millidegree: https://github.com/MichaIng/DietPi/issues/2715
if [[ $BENCH_CPU_TEMP_START =~ ^[0-9]+$ && $BENCH_CPU_TEMP_END =~ ^[0-9]+$ ]]
then
(( $BENCH_CPU_TEMP_START > 200 )) && (( BENCH_CPU_TEMP_START /= 1000 ))
(( $BENCH_CPU_TEMP_END > 200 )) && (( BENCH_CPU_TEMP_END /= 1000 ))
aBENCH_CPU_TEMP_START[$BENCH_HW_MODEL,${aBENCH_CPU_TEMP_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CPU_TEMP_START
aBENCH_CPU_TEMP_END[$BENCH_HW_MODEL,${aBENCH_CPU_TEMP_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CPU_TEMP_END
((aBENCH_CPU_TEMP_INDEX[$BENCH_HW_MODEL]++))
fi
((aBENCH_CPU_INDEX[$BENCH_HW_MODEL]++))
fi
# RootFS
if [[ $BENCH_ROOTFS_WRITE =~ ^[0-9]+$ && $BENCH_ROOTFS_READ =~ ^[0-9]+$ ]]; then
aBENCH_ROOTFS_WRITE[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_ROOTFS_WRITE
aBENCH_ROOTFS_READ[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]}]=$BENCH_ROOTFS_READ
((aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]++))
fi
# RAM
# - Skip results prior to DietPi-Benchmark v2 (DietPi v6.23): https://github.com/MichaIng/DietPi/issues/2715
if (( $BENCH_VERSION > 1 )) && [[ $BENCH_RAM_WRITE =~ ^[0-9]+$ && $BENCH_RAM_READ =~ ^[0-9]+$ ]]; then
aBENCH_RAM_WRITE[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_RAM_WRITE
aBENCH_RAM_READ[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]}]=$BENCH_RAM_READ
((aBENCH_RAM_INDEX[$BENCH_HW_MODEL]++))
fi
# Custom FS
if [[ $BENCH_CUSTOMFS_WRITE =~ ^[0-9]+$ && $BENCH_CUSTOMFS_READ =~ ^[0-9]+$ ]]; then
aBENCH_CUSTOMFS_WRITE[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CUSTOMFS_WRITE
aBENCH_CUSTOMFS_READ[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CUSTOMFS_READ
((aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]++))
fi
# LAN
if [[ $BENCH_NET_LAN_SPEED =~ ^[0-9]+$ ]]; then
aBENCH_NET_LAN_SPEED[$BENCH_HW_MODEL,${aBENCH_LAN_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_NET_LAN_SPEED
((aBENCH_LAN_INDEX[$BENCH_HW_MODEL]++))
fi
}
Main()
{
# Copy files to RAM to speed up sourcing
#mkdir -p /tmp/dietpi-survey_report
#cp /home/dietpi-survey/survey/*.txt /tmp/dietpi-survey_report/ # cp: Argument list too long
rm -Rf /tmp/dietpi-survey_report || exit 1
DATE_NOW=$(date -u '+%s') # Store date of last possible upload
cp -a /home/dietpi-survey/survey /tmp/dietpi-survey_report || exit 1
cd /tmp/dietpi-survey_report || exit 1
# Loop through files, including dot files, so that we can detect and sort out invalid file names
shopt -s dotglob
for file in *
do
# Skip and move away match with invalid name or when not a file
if ! [[ $file =~ ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.txt$ && -f $file ]]
then
echo 'Invalid file name'
mv -v "/home/dietpi-survey/survey/$file" /home/dietpi-survey/invalid/
continue
fi
# Optout files
if [[ ! -s $file ]]
then
# Sort out files that are > 6 months old
(( $DATE_NOW - $(date -u '+%s' -r "$file") < 15724800 )) || { mv "/home/dietpi-survey/survey/$file" /home/dietpi-survey/old/; ((SURVEY_COUNT_INACTIVE++)); continue; }
((SURVEY_COUNT_OPTOUT++))
# Count re-activated systems which didn't show activity for at least 6 months but uploaded a new survey file
if [[ -f /home/dietpi-survey/old/$file ]]
then
((SURVEY_COUNT_REACTIVE++))
# Remove old file
rm "/home/dietpi-survey/old/$file"
fi
continue
fi
# Process file
Process_File "$file"
done
shopt -u dotglob extglob
# Navigate to parent /tmp
cd /tmp || exit 1
# Clean up reports dir
rm -R /tmp/dietpi-survey_report || exit 1
# Total count
SURVEY_COUNT_TOTAL=$(( $SURVEY_COUNT_OPTOUT + $SURVEY_COUNT_OPTIN ))
# Merge old and new hardware model names
for i in "${!aDEVICE_NAME[@]}"
do
[[ $i == 'RPi B (ECN0001) (armv6l)' ]] && ((aDEVICE_NAME['RPi B (armv6l)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'RPi (armv6l)' ]] && ((aDEVICE_NAME['RPi (Unknown) (armv6l)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'RPi (armv7l)' ]] && ((aDEVICE_NAME['RPi (Unknown) (armv7l)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'Odroid XU3/XU4/HC1/HC2 (armv7l)' ]] && ((aDEVICE_NAME['Odroid XU3/XU4/MC1/HC1/HC2 (armv7l)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'Odroid C4 (aarch64)' ]] && ((aDEVICE_NAME['Odroid C4/HC4 (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]" # v6.35
[[ $i == 'Asus Tinker Board (armv7l)' ]] && ((aDEVICE_NAME['ASUS Tinker Board (armv7l)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'Pine A64 (aarch64)' ]] && ((aDEVICE_NAME['PINE A64 (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'Pine H64 (aarch64)' ]] && ((aDEVICE_NAME['PINE H64 (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'Rock64 (aarch64)' ]] && ((aDEVICE_NAME['ROCK64 (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'RockPro64 (aarch64)' ]] && ((aDEVICE_NAME['ROCKPro64 (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'Pinebook A64 (aarch64)' ]] && ((aDEVICE_NAME['Pinebook (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'Pinebook 1080p (aarch64)' ]] && ((aDEVICE_NAME['Pinebook (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'NanoPi Neo (armv7l)' ]] && ((aDEVICE_NAME['NanoPi NEO (armv7l)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'NanoPi NEO 2 (aarch64)' ]] && ((aDEVICE_NAME['NanoPi NEO2 (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'NanoPi M3/T3/F3 (aarch64)' ]] && ((aDEVICE_NAME['NanoPi M3/T3/Fire3 (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'NanoPi M3/T3/F3 (armv7l)' ]] && ((aDEVICE_NAME['NanoPi M3/T3/Fire3 (armv7l)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'BBB (armv7l)' ]] && ((aDEVICE_NAME['BeagleBone Black (armv7l)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]" # v7.1
[[ $i == 'Unknown Device (armv7l)' ]] && ((aDEVICE_NAME['Generic Device (armv7l)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'Unknown Device (aarch64)' ]] && ((aDEVICE_NAME['Generic Device (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]"
[[ $i == 'NanoPi M1/T1 (armv7l)' ]] && ((aDEVICE_NAME['NanoPi M1 (armv7l)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]" # v8.11
[[ $i == 'NanoPi R5S (aarch64)' ]] && ((aDEVICE_NAME['NanoPi R5S/R5C (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]" # v8.13
[[ $i == 'NanoPi R6S (aarch64)' ]] && ((aDEVICE_NAME['NanoPi 6 series (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]" # v8.17
[[ $i == 'ROCK Pi 4 (aarch64)' ]] && ((aDEVICE_NAME['ROCK 4 (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]" # v8.17
[[ $i == 'NanoPi R6S/R6C (aarch64)' ]] && ((aDEVICE_NAME['NanoPi 6 series (aarch64)']+=aDEVICE_NAME[$i])) && unset -v "aDEVICE_NAME[$i]" # v8.19
done
# Process all results, for later use in HTML printout
# - NB: HW_MODEL array based
# CPU
for i in "${!aBENCH_CPU_INDEX[@]}"
do
aBENCH_RESULT_CPU_MIN[i]=${aBENCH_CPU[$i,0]}
aBENCH_RESULT_CPU_MAX[i]=${aBENCH_CPU[$i,0]}
aBENCH_RESULT_CPU_AVG[i]=0