26 lines
865 B
Bash
26 lines
865 B
Bash
#!/bin/bash
|
|
|
|
source /home/orangepi/printio/.venv/bin/activate
|
|
|
|
# Stop the services
|
|
echo "printio stopping..."
|
|
sudo systemctl stop printio
|
|
#echo "printio_monitor stopping..."
|
|
#sudo systemctl stop printio_monitor
|
|
echo ""
|
|
|
|
# Use pyarmor to protect Python scripts in the printio directory
|
|
pyarmor gen -O /home/orangepi/printio/src/ /home/orangepi/printio_master/src_master/*.py
|
|
|
|
# Use rsync to copy files if they are different
|
|
rsync -av --progress /home/orangepi/printio_master/static/ /home/orangepi/printio/static/
|
|
rsync -av --progress /home/orangepi/printio_master/templates/ /home/orangepi/printio/templates/
|
|
rsync -av --progress /home/orangepi/printio_master/data/ /home/orangepi/printio/data/
|
|
|
|
# Start the services back up
|
|
echo ""
|
|
sudo systemctl start printio
|
|
echo "printio restarted..."
|
|
#sudo systemctl start printio_monitor
|
|
#echo "printio_monitor restarted..."
|