Compare commits
9 Commits
da458f0fc6
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7f3c83736 | ||
|
|
6985dd5104 | ||
|
|
c50b95a57b | ||
|
|
8ea2b03a26 | ||
|
|
d2529ed860 | ||
|
|
26cb7dd536 | ||
|
|
f9808e6711 | ||
|
|
be29316873 | ||
|
|
388d9d4d69 |
Submodule monitor/CMS deleted from 3e96a1694e
@@ -1 +0,0 @@
|
||||
...
|
||||
Binary file not shown.
1
monitor/log/capture/log.txt
Normal file
1
monitor/log/capture/log.txt
Normal file
@@ -0,0 +1 @@
|
||||
log
|
||||
1
monitor/log/log_engine/log.txt
Normal file
1
monitor/log/log_engine/log.txt
Normal file
@@ -0,0 +1 @@
|
||||
log
|
||||
@@ -1 +0,0 @@
|
||||
Check log_lancher
|
||||
1
monitor/log/log_launcher/log.txt
Normal file
1
monitor/log/log_launcher/log.txt
Normal file
@@ -0,0 +1 @@
|
||||
log
|
||||
@@ -1 +0,0 @@
|
||||
Check log_lancher
|
||||
8
monitor/setup/capture.sh
Normal file
8
monitor/setup/capture.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
##ssfull script
|
||||
export DISPLAY=:0
|
||||
DATE=$(date +%Y-%m-%d-%H:%M:%S)
|
||||
gnome-screenshot -f /root/monitor/log/capture/Screenshot-$DATE.png
|
||||
sshpass -p '1' scp -P 2122 -o StrictHostKeyChecking=no /root/monitor/log/capture/Screenshot-$DATE.png aibox@gitlab.beetsoft.com.vn:/home/aibox/capture_log
|
||||
echo "capture & copy done!"
|
||||
exit 0
|
||||
6
monitor/setup/configcam.json
Normal file
6
monitor/setup/configcam.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"camera": {
|
||||
"translate_x": 0,
|
||||
"traslate_y": 0
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
sudo chmod +x /root/monitor/CMS/run_cms.sh install.sh
|
||||
sudo /root/monitor/CMS/install.sh
|
||||
# ******************Autossh******************
|
||||
#
|
||||
sudo apt-get install -y autossh
|
||||
#
|
||||
echo "sleep 7
|
||||
|
||||
echo "Begin rc.local. Time restart: $time_begin" >> /root/monitor/log/rc_local.log
|
||||
|
||||
sudo /root/monitor/CMS/run_cms.sh" >> /etc/rc.local
|
||||
exit 0
|
||||
Binary file not shown.
121
monitor/setup/serverlite.sh
Normal file
121
monitor/setup/serverlite.sh
Normal file
@@ -0,0 +1,121 @@
|
||||
#!/bin/bash
|
||||
#*************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
|
||||
sudo chmod +x /root/monitor/check/Check_engine
|
||||
sudo chmod +x /root/monitor/launcher/S905X_BI
|
||||
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
|
||||
sudo chmod +x /root/monitor/setup/datetime
|
||||
sudo chmod +x /root/monitor/setup/update_serverlite.sh
|
||||
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 '#!/bin/sh -e
|
||||
#
|
||||
# rc.local
|
||||
#
|
||||
# This script is executed at the end of each multiuser runlevel.
|
||||
# Make sure that the script will "" on success or any other
|
||||
# value on error.
|
||||
#
|
||||
# In order to enable or disable this script just change the execution
|
||||
# bits.
|
||||
#
|
||||
# By default this script does nothing.
|
||||
|
||||
|
||||
#/boot/fan.sh &
|
||||
|
||||
if [ ! -d /var/run/sshd ]; then
|
||||
mkdir /var/run/sshd
|
||||
chmod 0755 /var/run/sshd
|
||||
systemctl restart ssh
|
||||
fi
|
||||
|
||||
echo "Begin rc.local. Time restart: $time_begin" >> /root/monitor/log/rc_local.log
|
||||
|
||||
echo "nameserver 8.8.8.8" > /etc/resolv.conf
|
||||
|
||||
tmux new -d -s server_js 'node /root/BiFace_Server_Config_API/server.js'
|
||||
|
||||
exit 0' > /etc/rc.local
|
||||
#
|
||||
echo "================================ update serverlite ==============================="
|
||||
sudo apt -y update
|
||||
sudo apt-get install -y apache2
|
||||
cd /var/www
|
||||
sudo chmod -R 0777 html
|
||||
cd html
|
||||
if [ "$1" = pro ]
|
||||
then git clone -b dev http://gitea.beetai.com/dongpd/BiFace_Server_Lite
|
||||
else git clone -b cloud http://gitea.beetai.com/dongpd/BiFace_Server_Lite
|
||||
fi
|
||||
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
|
||||
echo "
|
||||
<VirtualHost *:80>
|
||||
# The ServerName directive sets the request scheme, hostname and port that
|
||||
# the server uses to identify itself. This is used when creating
|
||||
# redirection URLs. In the context of virtual hosts, the ServerName
|
||||
# specifies what hostname must appear in the request's Host: header to
|
||||
# match this virtual host. For the default virtual host (this file) this
|
||||
# value is not decisive as it is used as a last resort host regardless.
|
||||
# However, you must set it for any further virtual host explicitly.
|
||||
#ServerName www.example.com
|
||||
|
||||
ServerAdmin webmaster@localhost
|
||||
#DocumentRoot /var/www/html
|
||||
DocumentRoot /var/www/html/BiFace_Server_Lite/web
|
||||
<Directory /var/www/html/BiFace_Server_Lite/web>
|
||||
Options Indexes FollowSymLinks
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
|
||||
# error, crit, alert, emerg.
|
||||
# It is also possible to configure the loglevel for particular
|
||||
# modules, e.g.
|
||||
#LogLevel info ssl:warn
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
|
||||
# For most configuration files from conf-available/, which are
|
||||
# enabled or disabled at a global level, it is possible to
|
||||
# include a line for only one particular virtual host. For example the
|
||||
# following line enables the CGI configuration for this host only
|
||||
# after it has been globally disabled with "a2disconf".
|
||||
#Include conf-available/serve-cgi-bin.conf
|
||||
</VirtualHost>
|
||||
|
||||
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
||||
" > /etc/apache2/sites-available/000-default.conf
|
||||
sudo a2enmod rewrite
|
||||
sudo service apache2 restart
|
||||
sudo echo "* * * * * php /var/www/html/BiFace_Server_Lite/yii sync" >> /var/spool/cron/crontabs/root
|
||||
#
|
||||
cd /root
|
||||
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
|
||||
sudo apt install -y npm
|
||||
cd BiFace_Server_Config_API
|
||||
npm install
|
||||
sudo bash /etc/rc.local
|
||||
cd /var/www/html/BiFace_Server_Lite
|
||||
sudo chmod 0777 db/app.db
|
||||
echo "================================ setup serverlite done! ================================"
|
||||
exit 0
|
||||
@@ -1,4 +1,9 @@
|
||||
#!/bin/bash
|
||||
#***************DNS****************************
|
||||
echo "nameserver 8.8.8.8" > /etc/resolv.conf
|
||||
sudo rm /var/lib/dpkg/lock
|
||||
sudo dpkg --configure -a
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
#***************set time****************************
|
||||
echo "Set timezon"
|
||||
unlink /etc/localtime
|
||||
@@ -6,15 +11,14 @@ ln -s /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime
|
||||
#*************cap quyen****************************
|
||||
echo "cap quyen"
|
||||
chown root:root /etc/sudoers
|
||||
#export DISPLAY =:0
|
||||
sudo chmod +x /root/monitor/cache/clearcache.sh
|
||||
sudo chmod +x /root/monitor/cache/restart_service.sh
|
||||
sudo chmod +x /root/monitor/check/Check_engine
|
||||
sudo chmod +x /root/monitor/launcher/S905X_BI
|
||||
sudo chmod +x /root/monitor/CMS/install.sh
|
||||
#sudo chmod +x /root/monitor/setup/serverUART
|
||||
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
|
||||
# ******************Autossh******************
|
||||
#
|
||||
echo "install auto ssh"
|
||||
@@ -23,9 +27,15 @@ sudo apt install -y autossh
|
||||
echo "install screen"
|
||||
sudo apt install -y screen
|
||||
chmod 777 /var/run/screen
|
||||
#****************run_cms rc.local*************
|
||||
#************capture***************
|
||||
echo "install lib capture"
|
||||
sudo apt install -y sshpass
|
||||
sudo apt install -y gnome-screenshot
|
||||
#************install v4l***************
|
||||
echo "install v4l"
|
||||
sudo apt-get install -y v4l-utils
|
||||
#****************rc.local*************
|
||||
echo "setup rc.local"
|
||||
echo > /etc/rc.local
|
||||
echo '#!/bin/sh -e
|
||||
#
|
||||
# rc.local
|
||||
@@ -50,7 +60,7 @@ fi
|
||||
|
||||
echo "Begin rc.local. Time restart: $time_begin" >> /root/monitor/log/rc_local.log
|
||||
|
||||
#sudo /root/monitor/CMS/run_cms.sh
|
||||
echo "nameserver 8.8.8.8" > /etc/resolv.conf
|
||||
|
||||
exit 0' > /etc/rc.local
|
||||
#
|
||||
@@ -73,44 +83,18 @@ ExecStart=/usr/bin/env /root/monitor/launcher/S905X_BI
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target" >> S905X_BI.service
|
||||
sudo chmod 755 /etc/systemd/system/S905X_BI.service
|
||||
sudo chmod 755 S905X_BI.service
|
||||
sudo systemctl start S905X_BI
|
||||
sudo systemctl enable S905X_BI
|
||||
#
|
||||
#******************serverUART*************************
|
||||
#echo "setup service serverUART"
|
||||
#cd /etc/systemd/system/
|
||||
#echo "[Unit]
|
||||
#Description=serverUART
|
||||
#After=network.target
|
||||
#StartLimitIntervalSec=0
|
||||
#[Service]
|
||||
#Type=simple
|
||||
#Restart=always
|
||||
#RestartSec=1
|
||||
#User=root
|
||||
#ExecStart=/usr/bin/env /root/monitor/setup/serverUART
|
||||
#
|
||||
#[Install]
|
||||
#WantedBy=multi-user.target" >> serverUART.service
|
||||
#sudo chmod 755 serverUART.service
|
||||
#sudo systemctl start serverUART
|
||||
#sudo systemctl enable serverUART
|
||||
#*************setup Opencv***************
|
||||
#echo "install Opencv"
|
||||
#cd /root/monitor/setup
|
||||
#tar -xvzf install_box-master.tar.gz
|
||||
#sudo chmod +x /root/monitor/setup/install_box/install_box.sh
|
||||
#sudo /root/monitor/setup/install_box/install_box.sh
|
||||
#
|
||||
#*************Copy key ssh***************
|
||||
echo "copy key"
|
||||
sudo /root/monitor/setup/key.sh
|
||||
rm /root/monitor/setup/key.sh
|
||||
#
|
||||
#*************setup schedule crontab**********
|
||||
echo "setup schedule crontab"
|
||||
echo "55 5 * * * sudo /root/monitor/cache/clearcache.sh" >> /var/spool/cron/crontabs/root
|
||||
echo "56 5 * * * sudo /root/monitor/cache/restart_service.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"
|
||||
@@ -123,7 +107,12 @@ autologin-user-timeout=0
|
||||
" >> 11-armbian.conf
|
||||
fi
|
||||
#
|
||||
sudo apt-get -y update
|
||||
rm /root/monitor/setup/key.sh
|
||||
#*************setup serverlite**********
|
||||
#sudo /root/monitor/setup/serverlite.sh
|
||||
#
|
||||
reboot
|
||||
#*************install p7zip-full**************
|
||||
sudo apt install p7zip-full
|
||||
#
|
||||
sudo apt-get -y update
|
||||
#
|
||||
reboot
|
||||
33
monitor/setup/update_serverlite.sh
Normal file
33
monitor/setup/update_serverlite.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
#*************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
|
||||
sudo chmod +x /root/monitor/check/Check_engine
|
||||
sudo chmod +x /root/monitor/launcher/S905X_BI
|
||||
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
|
||||
sudo chmod +x /root/monitor/setup/datetime
|
||||
sudo chmod +x /root/monitor/setup/update_serverlite.sh
|
||||
echo "================================ update serverlite ==============================="
|
||||
cd /var/www
|
||||
sudo chmod -R 0777 html
|
||||
cd html
|
||||
sudo rm -rf BiFace_Server_Lite
|
||||
if [ "$1" = pro ]
|
||||
then git clone -b dev http://gitea.beetai.com/dongpd/BiFace_Server_Lite
|
||||
else git clone -b cloud http://gitea.beetai.com/dongpd/BiFace_Server_Lite
|
||||
fi
|
||||
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
|
||||
cd /var/www/html/BiFace_Server_Lite
|
||||
sudo chmod 0777 db/app.db
|
||||
echo "================================ update serverlite done!!! ==============================="
|
||||
reboot
|
||||
Reference in New Issue
Block a user