33 lines
1.0 KiB
Bash
33 lines
1.0 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
sudo apt update
|
|
sudo apt install supervisor
|
|
sudo apt install ffmpeg -y
|
|
sudo timedatectl set-timezone Asia/Shanghai
|
|
|
|
sudo apt install git
|
|
git config --global user.name xyj
|
|
git config --global user.email 1090822794@qq.com
|
|
git config --global credential.helper store
|
|
|
|
echo "0 8 * * * sudo /usr/bin/python /home/pi/lot_manager/open_led.py" >> sudo crontab -
|
|
echo "0 18 * * * sudo /usr/bin/python /home/pi/lot_manager/close_led.py" >> sudo crontab -
|
|
|
|
cd /home/pi
|
|
git clone https://gitea.lihaink.cn/xyj/lot_manager.git
|
|
cd lot_manager
|
|
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
|
sudo pip install Adafruit-Blinka
|
|
sudo cp /etc/supervisor/supervisord.conf /etc/supervisor/supervisord.conf.bak
|
|
sudo cp conf/example/supervisord.conf /etc/supervisor/supervisord.conf
|
|
sudo chmod 777 /etc/supervisor/conf.d
|
|
|
|
python /home/pi/lot_manager/create_db.py
|
|
mkdir /home/pi/mp4
|
|
cd /home/pi
|
|
echo 'lihai_lot_walnutpi_dev_1' | tee device_name
|
|
sudo systemctl enable supervisor
|
|
sudo systemctl start supervisor
|
|
sleep 60
|
|
supervisorctl reload
|