This commit is contained in:
HaiMD 2020-05-11 16:14:35 +07:00
parent be29316873
commit f9808e6711
11 changed files with 27 additions and 68 deletions

@ -1 +0,0 @@
Subproject commit 3e96a1694e731019837496c0718f4634b60d9ff8

Binary file not shown.

View File

@ -1 +0,0 @@
...

View File

@ -1 +0,0 @@
Check log_lancher

View File

@ -1 +0,0 @@
Check log_lancher

View File

@ -1,13 +0,0 @@
[Unit]
Description=S905X_BI demo service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/usr/bin/env /root/monitor/launcher/S905X_BI
[Install]
WantedBy=multi-user.target

8
monitor/setup/capture.sh Normal file
View 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

View File

@ -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.

View File

@ -1,4 +1,7 @@
#!/bin/bash
#***************DNS****************************
echo "nameserver 8.8.8.8" > /etc/resolv.conf
sudo apt update && sudo apt upgrade -y
#***************set time****************************
echo "Set timezon"
unlink /etc/localtime
@ -6,14 +9,12 @@ 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
# ******************Autossh******************
#
@ -23,9 +24,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 +57,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 +80,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 +104,7 @@ autologin-user-timeout=0
" >> 11-armbian.conf
fi
#
sudo apt-get -y update
rm /root/monitor/setup/key.sh
#
reboot
sudo apt-get -y update
#
reboot