Skip to content

Instantly share code, notes, and snippets.

@minhdv118 minhdv118/install-view
Last active Jun 15, 2019

Embed
What would you like to do?
#!/bin/bash
running=$(ps -ef | grep "/root/scripts/main.js" | wc -l)
if [ $running -gt 1 ]; then
echo 'ALREADY INSTALLED'
exit;
fi
echo -e "a@654321\na@654321" | passwd
timedatectl set-timezone Asia/Ho_Chi_Minh
sed -re 's/^(PasswordAuthentication)([[:space:]]+)no/\1\2yes/' -i.`date -I` /etc/ssh/sshd_config
sed -re 's/^(PermitRootLogin)([[:space:]]+)no/\1\2yes/' -i.`date -I` /etc/ssh/sshd_config
service sshd restart
yum install -y pango libXcomposite libXcursor libXdamage libXext libXi libXtst cups-libs libXScrnSaver libXrandr GConf2 alsa-lib atk gtk3 ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc
yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash -
yum install -y nodejs
yum install -y wget
npm install forever -g
yum install -y sshpass
wget dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
rpm -ihv epel-release-7-11.noarch.rpm
yum install -y htop
cd /root
mkdir scripts
cd /root/scripts
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
sudo yum install -y ./google-chrome-stable_current_*.rpm
(crontab -l 2>/dev/null; echo "0 2 * * * perl -le 'sleep rand 14400' && /root/scripts/sync.sh >/dev/null 2>&1
*/5 * * * * /root/scripts/check.sh >> /root/scripts/check.log
*/5 * * * * /root/scripts/update.sh >> /root/scripts/update.log") | crontab -
sshpass -p 'a@654321' scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@34.87.16.239:/root/scripts/*.js* root@34.87.16.239:/root/scripts/*.sh /root/scripts/
sshpass -p 'a@654321' scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@34.87.16.239:/root/scripts/ublock /root/scripts/
sshpass -p 'a@654321' scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@34.87.16.239:/root/scripts/version /root/scripts/
npm i --unsafe-perm=true
forever start --killSignal=SIGTERM main.js run
echo 'INSTALLED OK'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.