Skip to content

Commit 2a1aa95

Browse files
authored
feat: attempt to resolve performance issues with rm earlier in build … (#1152)
…process <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Enhanced file integrity validation during installation for more reliable performance. - **Chores** - Streamlined the setup process by adding a cleanup step to remove outdated components post-installation. - Improved error handling and validation logic for checksum verification. - Adjusted command sequence for better clarity and control flow. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 52c70b9 commit 2a1aa95

File tree

2 files changed

+27
-11388
lines changed

2 files changed

+27
-11388
lines changed

plugin/plugins/dynamix.unraid.net.plg

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ sha256check() {
112112
fi
113113
}
114114
]]>
115-
sha256check "&source;.txz" "&SHA256;"
116-
exit 0
115+
sha256check "&source;.txz" "&SHA256;"
116+
exit 0
117117
</INLINE>
118118
</FILE>
119119
<FILE Name="/boot/config/plugins/dynamix.my.servers/&NODEJS_FILENAME;">
@@ -149,6 +149,7 @@ sha256check() {
149149
fi
150150
151151
echo "Node.js installation successful"
152+
152153
exit 0
153154
]]>
154155
</INLINE>
@@ -166,6 +167,7 @@ sha256check() {
166167
<![CDATA[
167168
# before proceeding with install, doubly confirm downloaded files exist. just being pedantic.
168169
FILE=${MAINTXZ} && [[ ! -f "$FILE" ]] && echo "⚠️ file missing - $FILE" && exit 1
170+
169171
exit 0
170172
]]>
171173
</INLINE>
@@ -203,9 +205,6 @@ echo "**********************************\n";
203205
echo "🧹 CLEANING UP - may take a minute\n";
204206
echo "**********************************\n";
205207
206-
# Clean up node_modules before package removal
207-
rm -rf /usr/local/unraid-api/node_modules
208-
209208
if (file_exists("/boot/.git")) {
210209
if (file_exists("/etc/rc.d/rc.flash_backup")) {
211210
# stop flash backup service
@@ -339,8 +338,8 @@ exit(0);
339338
<!-- uninstall existing plugin during update or removal -->
340339
<FILE Run="/bin/bash" Method="install remove">
341340
<INLINE>
342-
MAINNAME="&name;"
343341
<![CDATA[
342+
echo "Uninstalling existing plugin"
344343
version=
345344
# shellcheck disable=SC1091
346345
source /etc/unraid-version
@@ -366,8 +365,28 @@ if [ -e /etc/rc.d/rc.unraid-api ]; then
366365
# uninstall the api
367366
rm -rf /usr/local/unraid-api
368367
rm -rf /var/run/unraid-api.sock
369-
# uninstall the main source package
370-
[[ -f "/var/log/packages/${MAINNAME}" ]] && removepkg --terse "${MAINNAME}"
368+
fi
369+
]]>
370+
</INLINE>
371+
</FILE>
372+
373+
<FILE Run="/bin/bash" Method="remove">
374+
<INLINE>
375+
MAINNAME="&name;"
376+
<![CDATA[
377+
echo "Removing Plugin"
378+
[[ -f "/var/log/packages/${MAINNAME}" ]] && removepkg --terse "${MAINNAME}"
379+
]]>
380+
</INLINE>
381+
</FILE>
382+
383+
<!-- uninstall existing plugin during removal -->
384+
<FILE Run="/bin/bash" Method="install remove">
385+
<INLINE>
386+
<![CDATA[
387+
echo "Restoring Files"
388+
389+
if [ -e /etc/rc.d/rc.unraid-api ]; then
371390
# restore stock files
372391
FILES_TO_RESTORE=(
373392
"/usr/local/emhttp/plugins/dynamix/DisplaySettings.page"

0 commit comments

Comments
 (0)