-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrunpayments
41 lines (33 loc) · 1.32 KB
/
runpayments
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# Config section: adapt to your own needs.
# ----------------------------------------
# If you have Python3 virtual environment set up, point here to its 'activate'
# file. If you don't have a venv, then all modules etc. must be available to
# the global Python.
VENV_ACTIVATE="/home/ark/PayoutScriptArk/venv/bin/activate"
# How to invoke your Python. It must be version 3. Usually the default below
# is ok.
PYTHON3="python3"
# End of configuration. You should not alter anything below here.
# ---------------------------------------------------------------
# Let's see whether plugandplay.py script is already running. If so,
# don't start it again. This prevents overruns.
if [ -f /tmp/runpayments.is.running ] ; then
echo "runpayments is already running, not starting it again" 1>&2
exit 1
fi
trap "rm -f /tmp/runpayments.is.running" EXIT
touch /tmp/runpayments.is.running
# Source the virtual env if applicable
if [ -n "${VENV_ACTIVATE}" ] ; then
source "${VENV_ACTIVATE}"
if [ $? -ne 0 ] ; then
echo "runpayments could not source ${VENV_ACTIVATE}" 1>&2
echo "edit runpayments and set the configuration" 1>&2
exit 1
fi
fi
# Determine the base dir of this script. The Python scripts are expected
# right next to it.
dir=$(dirname $0)
"${PYTHON3}" "${dir}/plugandplay.py" || exit 1