#!/bin/sh
# @function - install node 9.0.x
function InstallST2NODE()
{
	ShowResult "[green]正在安装 NODE 9.0.x ... [/green]" 1
	cd ${_PATH_COMPILATION_} ${_SYS_SHOW_INSTALL_DETAILS_}
    tar zxvf ${_PATH_SOFTWARE_}/node-v9.*.tar.gz ${_SYS_SHOW_INSTALL_DETAILS_}
    eval mv node-v9.*/ /usr/local/nodejs ${_SYS_SHOW_INSTALL_DETAILS_}
	ln -sf /usr/local/nodejs/bin/node /usr/local/bin ${_SYS_SHOW_INSTALL_DETAILS_}
	ln -sf /usr/local/nodejs/bin/npm /usr/local/bin ${_SYS_SHOW_INSTALL_DETAILS_}
	ln -sf /usr/local/nodejs/bin/npm /usr/bin ${_SYS_SHOW_INSTALL_DETAILS_}
	ln -sf /usr/local/nodejs/bin/node /usr/bin ${_SYS_SHOW_INSTALL_DETAILS_}
	chown -R root:root /usr/local/nodejs
	ShowStatus $? 
}


function InstallDXBLNODE()
{
	ShowResult "[green]正在安装 NODE 10.15.x ... [/green]" 1
	cd ${_PATH_COMPILATION_} ${_SYS_SHOW_INSTALL_DETAILS_}
    tar zxvf ${_PATH_SOFTWARE_}/node-v10.*.tar.gz ${_SYS_SHOW_INSTALL_DETAILS_}
    eval mv node-v10.*/ /usr/local/nodejs ${_SYS_SHOW_INSTALL_DETAILS_}
	ln -sf /usr/local/nodejs/bin/node /usr/local/bin ${_SYS_SHOW_INSTALL_DETAILS_}
	ln -sf /usr/local/nodejs/bin/npm /usr/local/bin ${_SYS_SHOW_INSTALL_DETAILS_}
	ln -sf /usr/local/nodejs/bin/npm /usr/bin ${_SYS_SHOW_INSTALL_DETAILS_}
	ln -sf /usr/local/nodejs/bin/node /usr/bin ${_SYS_SHOW_INSTALL_DETAILS_}
	chown -R root:root /usr/local/nodejs
	npm -g install npm@6.9.0
	npm install -g forever
	ln -s /usr/local/nodejs/bin/forever /usr/bin/
	ShowStatus $? 
}