Compare commits
6 Commits
test_witho
...
master
Author | SHA1 | Date | |
---|---|---|---|
a35faaa21f | |||
7c101ca481 | |||
2cc4356a24 | |||
4638d029e5 | |||
984c8b5c43 | |||
0c1544d3e4 |
@ -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"
|
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
BASEPATH=`dirname $0`
|
||||
python $BASEPATH/file2mail.py
|
||||
$BASEPATH/venv/bin/python $BASEPATH/file2mail.py
|
||||
|
26
init_venv
26
init_venv
@ -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
2
requirements.txt
Normal file
@ -0,0 +1,2 @@
|
||||
pathlib
|
||||
psutil
|
Loading…
x
Reference in New Issue
Block a user