Current File : //root/nodejsinstallation.sh
echo -e "--------------------------------"
echo -e "1.Node.js 6"
echo -e "2.Node.js 8"
echo -e "3.Node.js 9"
echo -e "4.Node.js 10"
echo -e "--------------------------------"
echo -e "Enter your option >"
read javaversion
case "$javaversion" in
1) 
#curl --silent --location http://hostingraja.info/nodejs/setup_6.x | sudo bash -
curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash -
;;
2) 
#curl --silent --location http://hostingraja.info/nodejs/setup_8.x | sudo bash -
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
;;
3)
curl --silent --location https://rpm.nodesource.com/setup_9.x | sudo bash -
;;
4)
curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
;;
*) echo -e "You have entered wrong option. Try aftesometime"
	exit
   ;;
esac
mkdir /var/lib/rpm/backup
cp -a /var/lib/rpm/__db* /var/lib/rpm/backup/
rm -f /var/lib/rpm/__db.[0-9][0-9]*
rpm --quiet -qa
rpm --rebuilddb
yum clean all
yum -y install nodejs git  gcc-c++ make
npm install -g pm2
npm install -g grunt-cli
npm install -g gulp
npm install webpack -g
npm install express --save
#cd /etc/sentora/
#rm -f /etc/sentora/panel.zip
#wget  "http://hostingraja.info/nodejs/panel.zip"
#unzip -o panel.zip
#rm -f /etc/sentora/panel.zip
chown apache. -R "/etc/sentora/panel"
find /etc/sentora/panel -type f -exec chmod 644 {} +
find /etc/sentora/panel -type d -exec chmod 755 {} +
chmod +x /etc/sentora/panel/bin/setso
chmod +x /etc/sentora/panel/bin/zsudo
chmod +x /etc/sentora/panel/bin/setzadmin
wget  "http://hostingraja.info/Version2.0/nodejsmoduleenable.zip"
unzip -o nodejsmoduleenable.zip
php nodejsmoduleenable.php
rm -frv  nodejsmoduleenable.zip
kill -9 $(lsof -t -i:80)
kill -9 $(lsof -t -i:8080)
#php /etc/sentora/panel/node.php
setso --set apache_port 80
setso --set sentora_port 80
php /etc/sentora/panel/bin/daemon.php
service lighttpd restart
service varnish stop
service httpd restart
chkconfig varnish off