diff --git a/plugin/plugins/dynamix.unraid.net.plg b/plugin/plugins/dynamix.unraid.net.plg index 4f2269a6f..2b1e41608 100755 --- a/plugin/plugins/dynamix.unraid.net.plg +++ b/plugin/plugins/dynamix.unraid.net.plg @@ -14,7 +14,6 @@ - ]> @@ -50,7 +49,7 @@ exit 0 DLHOST=$(echo "&downloadserver;" | awk -F/ '{print $3}') -JSHOST=$(echo "&js_dl_server;" | awk -F/ '{print $3}') +NODEHOST=$(echo "&node_dl_server;" | awk -F/ '{print $3}') /dev/null; then exit 1 fi +# Check if node is installed in Unraid and install it if not +if [ ! -f /boot/extra/nodejs-20.18.0-x86_64-1.txz ]; then + echo "Downloading nodejs-20.18.0-x86_64-1.txz package" + mkdir -p /boot/extra wget https://mirrors.slackware.com/slackware/slackware64-current/slackware64/l/nodejs-20.18.0-x86_64-1.txz -O /boot/extra/nodejs-20.18.0-x86_64-1.txz + upgradepkg --install-new /boot/extra/nodejs-20.18.0-x86_64-1.txz +fi + dnscheck() { HOST=$1 if [ -x /usr/bin/host ] && ! /usr/bin/host -W 10 "${HOST}" &>/dev/null; then @@ -76,7 +82,7 @@ DNSERR=no echo "Checking DNS..." #dnscheck "${DLHOST}" -#dnscheck "${JSHOST}" +#dnscheck "${NODEHOST}" dnscheck "mothership.unraid.net" #dnscheck "wanip4.unraid.net" #dnscheck "backup.unraid.net" diff --git a/plugin/source/dynamix.unraid.net/pkg_build.sh b/plugin/source/dynamix.unraid.net/pkg_build.sh index b72ded583..561193a9f 100755 --- a/plugin/source/dynamix.unraid.net/pkg_build.sh +++ b/plugin/source/dynamix.unraid.net/pkg_build.sh @@ -47,11 +47,11 @@ cd "${DIR}" || exit 1 # define vars for plg pluginURL="https://stable.dl.unraid.net/unraid-api/\&name;.plg" downloadserver="https://stable.dl.unraid.net" -js_dl_server="https://registration.unraid.net" +node_dl_server="https://mirrors.slackware.com/slackware/slackware64-current/slackware64/l/nodejs-20.18.0-x86_64-1.txz" if [[ "${env}" == "staging" ]]; then pluginURL="https://preview.dl.unraid.net/unraid-api/\&name;.plg" downloadserver="https://preview.dl.unraid.net" - js_dl_server="https://registration-dev.unraid.net" + node_dl_server="https://mirrors.slackware.com/slackware/slackware64-current/slackware64/l/nodejs-20.18.0-x86_64-1.txz" fi # update plg file @@ -62,7 +62,7 @@ sed -i -E "s#(ENTITY pluginURL\s*)\".*\"#\1\"${pluginURL}\"#g" "${plgfile}" sed -i -E "s#(ENTITY MD5\s*)\".*\"#\1\"${md5}\"#g" "${plgfile}" sed -i -E "s#(ENTITY SHA256\s*)\".*\"#\1\"${sha256}\"#g" "${plgfile}" sed -i -E "s#(ENTITY downloadserver\s*)\".*\"#\1\"${downloadserver}\"#g" "${plgfile}" -sed -i -E "s#(ENTITY js_dl_server\s*)\".*\"#\1\"${js_dl_server}\"#g" "${plgfile}" +sed -i -E "s#(ENTITY node_dl_server\s*)\".*\"#\1\"${node_dl_server}\"#g" "${plgfile}" # set from environment vars sed -i -E "s#(ENTITY API_version\s*)\".*\"#\1\"${API_VERSION}\"#g" "${plgfile}"