them sh file setup

This commit is contained in:
HaiMD 2020-05-27 11:12:00 +07:00
parent 53a9e5553b
commit 33d0cd5eb1
3 changed files with 46 additions and 18 deletions

View File

@ -9,9 +9,18 @@ sudo chmod +x /root/monitor/setup/install_S905X_BI.sh
sudo chmod +x /root/monitor/setup/capture.sh
sudo chmod +x /root/monitor/setup/key.sh
sudo chmod +x /root/monitor/setup/serverlite.sh
#************install v4l***************
echo "================================ install v4l ================================"
sudo apt-get install -y v4l-utils
#************install tmux***************
echo "================================ install tmux ================================"
sudo apt install -y tmux
#*************install p7zip-full**************
echo "================================ install p7zip ================================"
sudo apt install -y p7zip-full
#
#****************rc.local*************
echo "setup rc.local"
echo "================================ setup rc.local ================================"
echo '#!/bin/sh -e
#
# rc.local
@ -48,7 +57,6 @@ sudo apt-get install -y apache2
cd /var/www
sudo chmod -R 0777 html
cd html
sudo rm -rf BiFace_Server_Lite
git clone http://gitea.beetai.com/dongpd/BiFace_Server_Lite.git
sudo chmod -R 0777 BiFace_Server_Lite
sudo apt-get install -y libapache2-mod-php php php-common php-curl php-dev php-gd php-pear php-imagick php-mysql php-xsl php-sqlite3 php-zip
@ -95,7 +103,6 @@ sudo service apache2 restart
sudo echo "* * * * * php /var/www/html/BiFace_Server_Lite/yii sync" >> /var/spool/cron/crontabs/root
#
cd /root
sudo rm -rf BiFace_Server_Config_API
git clone http://gitea.beetai.com/dongpd/BiFace_Server_Config_API.git
sudo apt-get install -y nodejs npm
sudo apt-get install -y nodejs-dev node-gyp libssl1.0-dev
@ -103,4 +110,5 @@ sudo apt install -y npm
cd BiFace_Server_Config_API
npm install
sudo bash /etc/rc.local
echo "================================ setup serverlite done! ================================"
exit 0

View File

@ -5,11 +5,11 @@ sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a
sudo apt update && sudo apt upgrade -y
#***************set time****************************
echo "Set timezon"
echo "================================ Set timezon ================================"
unlink /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime
#*************cap quyen****************************
echo "cap quyen"
echo "================================ cap quyen ================================"
chown root:root /etc/sudoers
sudo chmod +x /root/monitor/cache/clearcache.sh
sudo chmod +x /root/monitor/cache/restart_service.sh
@ -21,23 +21,28 @@ sudo chmod +x /root/monitor/setup/key.sh
sudo chmod +x /root/monitor/setup/serverlite.sh
# ******************Autossh******************
#
echo "install auto ssh"
echo "================================ install auto ssh ================================"
sudo apt install -y autossh
#*****************Screen********************
echo "install screen"
echo "================================ install screen ================================"
sudo apt install -y screen
chmod 777 /var/run/screen
#************capture***************
echo "install lib capture"
echo "================================ install lib capture ================================"
sudo apt install -y sshpass
sudo apt install -y gnome-screenshot
#************install v4l***************
echo "install v4l"
echo "================================ install v4l ================================"
sudo apt-get install -y v4l-utils
#************install tmux***************
echo "================================ install tmux ================================"
sudo apt install -y tmux
#*************install p7zip-full**************
echo "================================ install p7zip ================================"
sudo apt install -y p7zip-full
#
#****************rc.local*************
echo "setup rc.local"
echo "================================ setup rc.local ================================"
echo '#!/bin/sh -e
#
# rc.local
@ -72,7 +77,7 @@ echo "network"
echo -e "#IP#\n\n###" >> /etc/network/interfaces
#
#*************setup service S905X_BI***************
echo "setup autorun S905X_BI"
echo "================================ setup autorun S905X_BI ================================"
cd /etc/systemd/system/
sudo rm S905X_BI.service
echo "[Unit]
@ -92,17 +97,17 @@ sudo chmod 755 S905X_BI.service
#sudo systemctl start S905X_BI
#sudo systemctl enable S905X_BI
#*************Copy key ssh***************
echo "copy key"
echo "================================ copy key ================================"
sudo /root/monitor/setup/key.sh
rm /root/monitor/setup/key.sh
#
#*************setup schedule crontab**********
echo "setup schedule crontab"
echo "================================ setup schedule crontab ================================"
echo "55 5 * * * sudo /root/monitor/cache/clearcache.sh" >> /var/spool/cron/crontabs/root
echo "50 5 * * * sudo /root/monitor/cache/restart_service.sh" >> /var/spool/cron/crontabs/root
#
#*************setup autologin***************
echo "setup autologin"
echo "================================ setup autologin ================================"
os_version=$(cat /etc/issue |grep "Ubuntu 18.04")
if [ -n "$os_version" ]; then
sudo apt-get install -y rng-tools
@ -113,11 +118,10 @@ autologin-user-timeout=0
fi
#
#*************setup serverlite**********
#sudo /root/monitor/setup/serverlite.sh
#
#*************install p7zip-full**************
sudo apt install p7zip-full
echo "================================ setup serverlite ================================"
sudo /root/monitor/setup/serverlite.sh
#
echo "================================ update ================================"
sudo apt-get -y update
#
reboot

View File

@ -0,0 +1,16 @@
#!/bin/bash
echo "================================ update serverlite ==============================="
cd /var/www
sudo chmod -R 0777 html
cd html
sudo rm -rf BiFace_Server_Lite
git clone http://gitea.beetai.com/dongpd/BiFace_Server_Lite.git
sudo chmod -R 0777 BiFace_Server_Lite
cd /root
sudo rm -rf BiFace_Server_Config_API
git clone http://gitea.beetai.com/dongpd/BiFace_Server_Config_API.git
cd BiFace_Server_Config_API
#npm install
sudo bash /etc/rc.local
echo "================================ update serverlite done!!! ==============================="
exit 0