Last active
November 9, 2017 20:53
-
-
Save LinZap/55c2735b3baa1901037c to your computer and use it in GitHub Desktop.
Node.js Upgrade on QNAP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
URL=$1 | |
[[ $URL =~ (node-v5\.8\.0-.*)\.tar\.gz$ ]] && TARFile=${BASH_REMATCH[0]} && DirName=${BASH_REMATCH[1]} | |
[[ $TARFile == "" ]] && echo "url is wrong" && exit | |
NodeJSPath=$(/sbin/getcfg nodejs Install_Path -f /etc/config/qpkg.conf) | |
wget --no-check-certificate $URL | |
tar zxf $TARFile -C $NodeJSPath | |
rm -r $NodeJSPath/node $TARFile | |
ln -s $NodeJSPath/$DirName $NodeJSPath/node | |
uidscript=$NodeJSPath/$DirName/lib/node_modules/npm/node_modules/uid-number/uid-number.js | |
script="$(cat $uidscript)" | |
echo "${script/", uidSupport = process.getuid && process.setuid"/, uidSupport = false}" > $uidscript | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NodeJS Upgrade Script
An Automation Upgrade Script
Usage
URL: NodeJS source url
NodeJS Download Page
NodeJS v5.8.0 Download Page