REPORTS/setup-info.sh

27 lines
658 B
Bash

#!/bin/bash
## Ordner anlegen
mkdir /root/REPORTS
cd /root/REPORTS
## APT UPDATE
apt update
apt install python3-pip git -y
## Add GIT
git init
git remote add orgin https://gitlab.stines.de/sebastian.serfling/REPORTS.git
git fetch
git pull orgin main
## Add Crontab
crontab -l | { cat; echo "30 0 * * * /root/REPORTS/setup-info.sh"; } | crontab -
## Install Python
python3 -m pip install virtualenv
python3 -m virtualenv venv
source venv/bin/activate
python3 -m pip install -r packages.txt
python3 -m pip uninstall mysql-connector -y ## Fix for Connection Issue
python3 -m pip install mysql-connector ## Fix for Connection Issue
python3 main.py
deactivate