Compare commits

...

6 Commits

4 changed files with 28 additions and 10 deletions

View File

@ -1,14 +1,14 @@
# Folder to be monitored for new files
TARGET_FOLDER = "<target_folder>"
TARGET_FOLDER = "{{ server_ftp_scan_target_folder }}"
# Recipiant for the files found in TARGET_PATH
SEND_TO = "scan@mount-mockery.de"
# Sender
SEND_FROM = "Scanner <scan@<smtp_server>>"
SMTP_SERVER = "<smtp_server>"
SMTP_USER = "<smtp_user>"
SMTP_PASSWORD = "<smtp_password>"
SMTP_SERVER = "{{ server_ftp_scan_smtp_server }}"
SMTP_USER = "{{ server_ftp_scan_smtp_user }}"
SMTP_PASSWORD = "{{ server_ftp_scan_smtp_password }}"
# Possible log-levels: DEBUG, INFO, WARNING, ERROR
LOG_LEVEL = "INFO"

View File

@ -1,4 +1,4 @@
#!/bin/sh
#
BASEPATH=`dirname $0`
python $BASEPATH/file2mail.py
$BASEPATH/venv/bin/python $BASEPATH/file2mail.py

View File

@ -1,8 +1,24 @@
#!/bin/sh
#!/bin/bash
#
BASEPATH=`realpath $(dirname $0)`
python3 -m venv $BASEPATH/venv
$BASEPATH/venv/bin/pip install --upgrade pip
find $BASEPATH -name requirements.txt | xargs -L 1 $BASEPATH/venv/bin/pip install -r
$BASEPATH/venv/bin/pip list --outdated --format=json | jq -r '.[] | .name'|xargs -n1 $BASEPATH/venv/bin/pip install -U
#
# Create venv
#
if [[ ! -e $BASEPATH/venv ]]; then
python3 -m venv $BASEPATH/venv > /dev/null 2>&1
# $BASEPATH/venv/bin/pip install --upgrade pip
find $BASEPATH -name requirements.txt | xargs -L 1 $BASEPATH/venv/bin/pip install -r > /dev/null 2>&1
echo "venv changed"
fi
#
# Update venv modules
#
for req_mod in $($BASEPATH/venv/bin/pip list --format=json | jq -r '.[] | .name'); do
$BASEPATH/venv/bin/pip install -U $req_mod | grep install > /dev/null 2>&1
if [[ "$?" -eq "0" ]]; then
echo $req_mod changed
fi
done
#|xargs -n1 $BASEPATH/venv/bin/pip install -U

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
pathlib
psutil