forked from Steini1984/unRAID6-ZFS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unRAID6-ZFS.plg
629 lines (528 loc) · 24 KB
/
unRAID6-ZFS.plg
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
<?xml version='1.0' standalone='yes'?>
<!-- PLUGIN DEFINITIONS -->
<!DOCTYPE PLUGIN [
<!ENTITY name "unRAID6-ZFS">
<!ENTITY author "Steini1984">
<!ENTITY version "2.1.6">
<!ENTITY repo "https://raw.githubusercontent.com/&author;/unRAID6-ZFS/master">
<!ENTITY pluginURL "&repo;/&name;.plg">
<!ENTITY plugin "/boot/config/plugins/&name;">
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
<!ENTITY packages "/boot/config/plugins/&name;/packages">
]>
<PLUGIN name="&name;"
author="&author;"
version="&version;"
pluginURL="&pluginURL;"
min="6.6.6"
max="6.12.0-beta3"
support="https://forums.unraid.net/topic/41333-zfs-plugin-for-unraid/"
>
<CHANGES>
###2022.12.21
- Set max version to 6.12.0-beta3
- Removed Unraid-Plugin-Helper
###2022.07.21
- Version detection from package via GitHub API
- Save md5 in packages directory
###2022.07.19
- Fixed bug for ZFS in Plugin Update Helper
###2022.07.17
- Necessary changes for unRAID 6.11+
###2022.05.06
- When notifications via Mail is setup don't send message about download progress anymore
###2022.04.11
- Removed warning message from console on boot
###2022.01.31
- Added automatic scrub from all ZFS pools after unclean shutdown
- Added option to turn of automatic scrub after unclean shutdown to settings file
###2022.01.20
- Changed back to Kernel detection instead of unRAID version detection
- Changed to Github Releases for ZFS Packages
###2021.08.23
- Added the Plugin Update Helper from ich777
###2020.11.14
- Made changes regarding modules instroduced in 6.9.0-beta35
###2020.10.23
- Added the ability to download unstable builds of ZFS by having a file named /boot/config/plugins/unRAID6-ZFS/USE_UNSTABLE_BUILDS
###2020.06.19
- Updated the version number to clear things up. The plugin does not need to be updated for new builds - the plugin checks for available builds on boot
###2020.01.09
- Rewrote the plugin so it does not need to be updated everytime unRAID is upgraded. It checks if there is already a new build available and installs that
- For simplicity sake I removed support for versions older than 6.6.6
###2019.12.11
- Updated for unRAID 6.8.0 (kernel 4.19.88)
###2019.12.07
- Updated for unRAID 6.8.0-rc9 (kernel 4.19.88)
###2019.12.05
- Updated for unRAID 6.8.0-rc8 (kernel 4.19.87)
###2019.11.23
- Updated for unRAID 6.8.0-rc7 (kernel 5.3.12)
###2019.11.07
- Updated for unRAID 6.8.0-rc6 (kernel 5.3.11)
###2019.11.01
- Updated for unRAID 6.8.0-rc5 (kernel 5.3.8)
###2019.10.24
- Updated for unRAID 6.8.0-rc4 (kernel 5.3.7)
###2019.10.12
- No changes for unRAID 6.8.0-rc3 (kernel 5.3.6)
###2019.10.12
- Updated for unRAID 6.8.0-rc1 (kernel 5.3.6)
- Updated to zfs-0.8.2
###2019.07.11
- Updated for unRAID 6.7.2 (kernel 4.19.56)
###2019.06.24
- Updated for unRAID 6.7.1 (kernel 4.19.55)
- Updated to zfs-0.8.1
- Removed SPL - The SPL source is now included in the ZFS repository removing the need for separate packages
###2019.05.16
- Updated for unRAID 6.7.0 (kernel 4.19.41)
- Updated to spl-0.7.13 / zfs-0.7.13
###2019.03.07
- Just a version bump to align with 6.6.7 (same kernel 4.18.20)
###2018.12.05
- Updated for unRAID 6.6.6 (kernel 4.18.20)
- Updated to Zfs and Spl 0.7.12
###2018.11.10
- Updated for unRAID 6.6.5 (kernel 4.18.17)
###2018.10.22
- Updated for unRAID 6.6.3 (kernel 4.18.15)
###2018.10.14
- Updated for unRAID 6.6.2 (kernel 4.18.14)
###2018.09.28
- Updated for unRAID 6.6.1 (kernel 4.18.10)
###2018.09.21
- Updated for unRAID 6.6.0 (kernel 4.18.8)
- Updated to zfs and spl 0.7.11
###2018.05.16
- Updated for unRAID 6.5.2 (kernel 4.14.40)
- Updated to zfs and spl 0.7.9
###2018.04.25
- Updated for unRAID 6.5.1 (kernel 4.14.35)
- Updated to zfs and spl 0.7.8
###2018.03.14
- Updated for unRAID 6.5.0 (kernel 4.14.26)
###2018.02.07
- Updated for unRAID 6.4.1 (kernel 4.14.16)
- Updated to zfs and spl 0.7.6
- Stopped using custom bzmodules
###2018.01.16
- Updated for unRAID 6.4 (big thanks to rinseaid)
- Updated to zfs and spl 0.7.5 (kernel 4.14.13)
- Removed support for 6.2.X and 6.3.0
###2017.10.11
- Updated to zfs and spl 0.7.2 (kernel 4.9.30)
- A collection of great features got added in the 0.7 branch: https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.0
###2017.05.27
- Updated for unRAID 6.3.5 (kernel 4.9.30)
- Removed support for 6.2.1
###2017.05.21
- Updated for unRAID 6.3.4 (kernel 4.9.28)
- Removed support for 6.1.9 and 6.2.0
###2017.03.31
- Updated for unRAID 6.3.3 (kernel 4.9.19)
###2017.02.20
- Updated for unRAID 6.3.2 (kernel 4.9.10)
###2017.02.05
- Updated for unRAID 6.3.1 (kernel 4.9.8)
###2017.02.05
- Updated for unRAID 6.3 (kernel 4.9.7)
- Updated to spl-0.6.5.9 / zfs-0.6.5.9
- Removed all 6.3 rc versions
###2016.11.07
- Updated to 6.2.4 (kernel 4.4.30)
- Removed all 6.2 rc versions
###2016.10.25
- Updated to 6.2.2 (kernel 4.4.26)
- Removed 6.1.8
###2016.10.25
- Updated to 6.3.rc3 (kernel 4.8.3)
###2016.09.13
- Updated to 6.2.1 (kernel 4.4.23)
###2016.09.13
- Updated to spl-0.6.5.8 / zfs-0.6.5.8
- Updated to 6.2.0-stable (kernel 4.4.19)
###2016.09.13
- Updated to 6.2.0-rc5 (kernel 4.4.19)
- Removed support for all 6.2.0 beta versions
###2016.08.23
- Updated to 6.2.0-rc4 (kernel 4.4.18)
- Removed support for 6.2.0 beta 18-19
###2016.07.14
- Updated to 6.2.0-rc2 (kernel 4.4.15)
###2016.07.12
- Updated to 6.2.0-rc1 (kernel 4.4.14)
###2016.06.14
- Updated to 6.2.0-beta23 (kernel 4.4.13)
###2016.06.10
- Updated to 6.2.0-beta22 (kernel 4.4.13)
- Remove support for 6.1.7
- Update to spl-0.6.5.7 / zfs-0.6.5.7
###2016.04.06
- Updated to 6.2.0-beta21 (kernel 4.4.6)
###2016.03.31
- Updated to 6.2.0-beta20 (kernel 4.4.6)
- Updated to zfs 0.6.5.6 and spl 0.6.5.6
- Removed support for 6.1.4 - 6.1.6
###2016.03.21
- remove support for 6.1.2 - 6.1.3
###2016.03.21
- Update to 6.2.0-beta19 (kernel 4.4.5)
###2016.03.12
- Only download needed tgz (Thanks gfjardim)
- Remove old tgz
###2016.03.11
- Change plugin to support unRAID 6.1.2 - 6.2.0-beta18 (kernel 4.4.4)
- Update to spl-0.6.5.5 / zfs-0.6.5.5
###2016.03.06
- update to unRAID 6.1.9 (kernel 4.1.18)
###2016.02.10
- update to unRAID 6.1.8 (kernel 4.1.17)
###2016.01.18
- Remove old packages
###2016.01.18
- Change path of the zfs tools
###2016.01.18
- update to unRAID 6.1.7 (kernel 4.1.15)
###2015.11.18
- document unRAID 6.1.5 - 6.1.6 (no change in kernel)
###2015.11.18
- update to unRAID 6.1.4 (kernel 4.1.13)
###2015.10.24
- update to spl-0.6.5.3 / zfs-0.6.5.3
###2015.09.21
- update to unRAID 6.1.3 (kernel 4.1.7)
###2015.09.20
- update to spl-0.6.5.1 / zfs-0.6.5.1
###2015.09.19
- OpenZFS version 0.6.5 for unRAID 6.1.2 (and all versions running kernel 4.1.5-unRAID)
</CHANGES>
<FILE Name="&emhttp;/README.md">
<INLINE>
**ZFS for unRAID 6**
The native Linux kernel port of the ZFS filesystem. Allows you to use ZFS format on non Array disks.
This plugin is console only (no GUI)!
</INLINE>
</FILE>
<FIL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Dwxa0CEZDokKxbgVYkY
EVrSIYlYAKqknSewBhEBFBDSoSMWWFSV0HligUVVERE+o+DVE4tZKq68mNOP64toxjtrNzJ+2lz2
NDUTswav/AsjglclYkTwquzPiOBViRgRvCr7MyJ4VSJGBK/K/owIXpWIEcGr8mVGIO08bXKymTFx
NAN7dUWcc5p2ngl/fJDnlqygdW42RoTDkVdlT2MzZx/fn8qfXUJgDeK9VxFhw9ad3DD3cVaub6A5
lUIVEA4PCiKQHY/Tr3s+N4++kG6d2qGqiO6DiKCqLK+rZ/uevXhVRDgsqIIRoUPrPAYUFiAiqCoi
gmgGGapKREQ4nKkqEREh8n/80SG09T7rVQAAAABJRU5ErkJggiAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICA=
</INLINE>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
download() {
# Download ZFS package
if wget -q -nc --show-progress --progress=bar:force:noscroll -O "&packages;/${KERNEL_V%%-*}/${LAT_PACKAGE}" "${DL_URL}/${LAT_PACKAGE}" ; then
wget -q -nc --show-progress --progress=bar:force:noscroll -O "&packages;/${KERNEL_V%%-*}/${LAT_PACKAGE}.md5" "${DL_URL}/${LAT_PACKAGE}.md5"
if [ "$(md5sum &packages;/${KERNEL_V%%-*}/${LAT_PACKAGE} | awk '{print $1}')" != "$(cat &packages;/${KERNEL_V%%-*}/${LAT_PACKAGE}.md5 | awk '{print $1}')" ]; then
echo
echo "----ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR----"
echo "-----------------------CHECKSUM ERROR!-----------------------"
rm -rf &plugin; &emhttp;
exit 1
fi
echo
echo "----Successfully downloaded ZFS package, please wait...!-----"
else
echo
echo "----ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR----"
echo "-----------------Can't download ZFS package------------------"
rm -rf &plugin; &emhttp;
exit 1
fi
}
check() {
if ! ls -1 &packages;/${KERNEL_V%%-*}/ | grep -q "${PACKAGE}" ; then
echo
echo "---------Downloading ZFS v$(echo $LAT_PACKAGE | cut -d '-' -f2), please wait...!----------"
echo "---This could take some time, please don't close this window!---"
download
else
echo
echo "----------------ZFS v$(echo $LAT_PACKAGE | cut -d '-' -f2) found locally!-----------------"
fi
}
install() {
# Install ZFS
/sbin/installpkg "&packages;/${KERNEL_V%%-*}/${PACKAGE}*.tgz"
/sbin/depmod -a
}
activate() {
# Enable ZFS and import all ZFS pools
/sbin/modprobe zfs
zpool import -a >/dev/null 2>&1
# Fix for the icon
chmod 755 /usr/local/emhttp/plugins/unRAID6-ZFS/
}
get_versions() {
# Check if unstable versions are available and fall back to stable if no unstable detected
if [ "$UNSTABLE_BUILDS" == "true" ]; then
AVAIL_V="$(wget -qO- https://api.github.com/repos/Steini1984/unRAID6-ZFS/releases/tags/${KERNEL_V} | jq -r '.assets[].name' | grep "${PACKAGE}" | grep -E -v '\.md5$' | sort -V)"
if [ -z "$(echo "$AVAIL_V" | grep -E "rc|beta")" ]; then
echo
echo "--------------No unstable version from ZFS for---------------"
echo "---Kernel v${KERNEL_V%%-*} found, falling back to stable!----"
sed -i '/unstable_packages=/c\unstable_packages=false' "&plugin;/settings.cfg"
AVAIL_V="$(echo "$AVAIL_V" | grep -v -E "rc|beta")"
else
AVAIL_V="$(echo "$AVAIL_V" | grep -E "rc|beta")"
fi
else
AVAIL_V="$(wget -qO- https://api.github.com/repos/Steini1984/unRAID6-ZFS/releases/tags/${KERNEL_V} | jq -r '.assets[].name' | grep -E "${PACKAGE}" | grep -E -v '\.md5$' | sort -V | grep -v -E "rc|beta")"
fi
}
# Define Variables
KERNEL_V="$(uname -r)"
PACKAGE="zfs"
DL_URL="https://github.com/Steini1984/unRAID6-ZFS/releases/download/$KERNEL_V"
# Create packages directory if non existent
if [ ! -d "&packages;/${KERNEL_V%%-*}" ]; then
mkdir -p "&packages;/${KERNEL_V%%-*}"
fi
# Create settings file if not found
if [ ! -f "&plugin;/settings.cfg" ]; then
echo 'check_for_updates=true
unstable_packages=false
unclean_shutdown_scrub=true' > "&plugin;/settings.cfg"
fi
# Add missing entries to settings file if not exists
if [ ! "$(grep "unclean_shutdown_scrub=" &plugin;/settings.cfg)" ]; then
echo "unclean_shutdown_scrub=true" >> &plugin;/settings.cfg
fi
# Get variables for update check and unstable builds
UPDATE_CHECK="$(cat &plugin;/settings.cfg | grep "check_for_updates" | cut -d '=' -f2)"
UNSTABLE_BUILDS="$(cat &plugin;/settings.cfg | grep "unstable_packages" | cut -d '=' -f2)"
# Move old package directory to new package directory to be compliant with 6.11
if find &packages; -maxdepth 1 -type f -name "*.tgz" 2>/dev/null ; then
if [ ! -d "&packages;/${KERNEL_V%%-*}" ]; then
mkdir -p "&packages;/${KERNEL_V%%-*}"
fi
mv $(find &packages; -maxdepth 1 -type f -name "*.tgz") &packages;/${KERNEL_V%%-*}/ 2>/dev/null
fi
# Get local package version if available
CUR_V="$(ls -p &packages;/${KERNEL_V%%-*} 2>/dev/null | grep -E -v '\.md5' | sort -V | tail -1)"
# Check if update check is enabled and set version
if [ "$UPDATE_CHECK" != "true" ]; then
if [ -z "$CUR_V" ]; then
get_versions
LAT_PACKAGE="$(echo "$AVAIL_V" | sort -V | tail -1)"
if [ -z "$LAT_PACKAGE" ]; then
echo
echo "----ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR----"
echo "---Can't get latest ZFS version and found no local package---"
rm -rf &plugin; &emhttp;
exit 1
fi
else
LAT_PACKAGE="${CUR_V}"
fi
else
get_versions
LAT_PACKAGE="$(echo "$AVAIL_V" | sort -V | tail -1)"
if [ -z "$LAT_PACKAGE" ]; then
if [ -z "$CUR_V" ]; then
echo
echo "----ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR----"
echo "---Can't get latest ZFS version and found no local package---"
rm -rf &plugin; &emhttp;
exit 1
else
LAT_PACKAGE="${CUR_V}"
echo
echo "---Can't get latest ZFS version, using local ZFS package v$(echo $LAT_PACKAGE | cut -d '-' -f2)!---"
fi
fi
fi
# Check for old packages
rm -rf $(ls -d &packages;/* | grep -v "${KERNEL_V%%-*}")
rm -rf $(find &packages;/${KERNEL_V%%-*}/ -type f -maxdepth 1 | grep -v "${KERNEL_V%%-*}")
rm -rf $(find &packages;/${KERNEL_V%%-*}/ -type f -maxdepth 1 | grep -v "${LAT_PACKAGE}")
# Check for old packages and if ZFS is available locally
check
# Check if package is already installed, if not install it, and activate it
if ! modinfo zfs -0 >/dev/null 2>&1 ; then
echo
echo "----------Installing ZFS v$(echo $LAT_PACKAGE | cut -d '-' -f2), please wait...!----------"
install >/dev/null
activate >/dev/null
echo
echo "----------Installation of ZFS v$(echo $LAT_PACKAGE | cut -d '-' -f2) successful!----------"
echo
else
activate >/dev/null
echo
echo "----------Installation of ZFS v$(echo $LAT_PACKAGE | cut -d '-' -f2) successful!----------"
echo
fi
# Get zpools and scrub them if unclean shutdown was detected depending if enabled or not
if [ "$(grep "unclean_shutdown_scrub=" &plugin;/settings.cfg | cut -d '=' -f2)" == "true" ]; then
#Create scrub_finish-notify.sh
mkdir -p /etc/zfs/zed.d
cat << EOF > /etc/zfs/zed.d/scrub_finish-notify.sh
#!/bin/bash
healthy="\$("\${ZPOOL}" status -x "\${ZEVENT_POOL}" | grep "'\${ZEVENT_POOL}' is healthy")"
if [ -z "\${healthy}" ]; then
extra="-i alert -l https://forums.unraid.net/topic/41333-zfs-plugin-for-unraid/"
message="ZFS Scrub for Pool: \${ZEVENT_POOL} finished! Pool degraded! Click this message to go to the ZFS support thread on the unRAID Forums!"
else
message="ZFS Scrub for Pool: \${ZEVENT_POOL} finished! Pool is healthy!"
fi
/usr/local/emhttp/plugins/dynamix/scripts/notify -e "unRAID-ZFS" -d "\${message}" \${extra}
EOF
chmod 755 /etc/zfs/zed.d/scrub_finish-notify.sh
echo "zed -d /etc/zfs/zed.d" | at now > /dev/null 2>&1
if [ ! $(pidof emhttpd) ] && [ -f /boot/config/forcesync ]; then
ZPOOLS="$(zpool list -o name | tail -n +2)"
echo
echo "Unclean shutdown detected, starting ZFS Scrub for Pool(s): ${ZPOOLS//$'\n'/, }!"
echo
/usr/local/emhttp/plugins/dynamix/scripts/notify -e "unRAID-ZFS" -d "Unclean shutdown detected, started Scrub for Pool(s): ${ZPOOLS//$'\n'/, }!"
while read -r line
do
echo "zpool scrub $line" | at now > /dev/null 2>&1
done <<< "${ZPOOLS}"
fi
fi
</INLINE>
</FILE>
<!-- PLUGIN REMOVAL SCRIPT -->
<FILE Run="/bin/bash" Method="remove">
<INLINE>
echo "+=============================================================================="
echo "| Uninstalling OpenZFS"
echo "+=============================================================================="
# Remove plugin related files
rm -rf &emhttp;
rm -rf &plugin;
echo
echo "OpenZFS plugin uninstalled. ZFS will be active until next reboot!"
</INLINE>
</FILE>
</PLUGIN>