File tree Expand file tree Collapse file tree 2 files changed +56
-2
lines changed
tests/fixture/confs-stdlocal Expand file tree Collapse file tree 2 files changed +56
-2
lines changed Original file line number Diff line number Diff line change 22#
33# run indexdoi as mig user
44
5+ # Force bash to handle uninitialized variables and errors
6+ # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
7+ # NOTE: 'set -eE' exits on failure, which is good when we handle all errors
8+ set -eEuo pipefail
9+
10+
511# No more edits below
6- su - mig -c " PYTHONPATH=__MIG_BASE__ mig/server/indexdoi.py"
12+ check_enabled () {
13+ su - mig -c " PYTHONPATH=__MIG_BASE__ __MIG_CODE__/server/chkenabled.py $1 " >& /dev/null
14+ }
15+ check_set () {
16+ VALUE=$( su - mig -c " PYTHONPATH=__MIG_BASE__ __MIG_CODE__/server/readconfval.py $1 " )
17+ if [ -z " $VALUE " ]; then
18+ # echo "DEBUG: $1 not set in MiGserver conf - skipping"
19+ return 1
20+ fi
21+ return 0
22+ }
23+
24+ if ! check_enabled " freeze" ; then
25+ # echo "DEBUG: nothing to do with freeze disabled"
26+ exit 0
27+ fi
28+ if ! check_set " site_freeze_doi_url" ; then
29+ # echo "DEBUG: nothing to do with freeze doi url disabled"
30+ exit 0
31+ fi
32+
33+ su - mig -c " PYTHONPATH=__MIG_BASE__ __MIG_CODE__/server/indexdoi.py"
734
835exit 0
Original file line number Diff line number Diff line change 22#
33# run indexdoi as mig user
44
5+ # Force bash to handle uninitialized variables and errors
6+ # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
7+ # NOTE: 'set -eE' exits on failure, which is good when we handle all errors
8+ set -eEuo pipefail
9+
10+
511# No more edits below
6- su - mig -c " PYTHONPATH=/home/mig mig/server/indexdoi.py"
12+ check_enabled () {
13+ su - mig -c " PYTHONPATH=/home/mig /home/mig/mig/server/chkenabled.py $1 " >& /dev/null
14+ }
15+ check_set () {
16+ VALUE=$( su - mig -c " PYTHONPATH=/home/mig /home/mig/mig/server/readconfval.py $1 " )
17+ if [ -z " $VALUE " ]; then
18+ # echo "DEBUG: $1 not set in MiGserver conf - skipping"
19+ return 1
20+ fi
21+ return 0
22+ }
23+
24+ if ! check_enabled " freeze" ; then
25+ # echo "DEBUG: nothing to do with freeze disabled"
26+ exit 0
27+ fi
28+ if ! check_set " site_freeze_doi_url" ; then
29+ # echo "DEBUG: nothing to do with freeze doi url disabled"
30+ exit 0
31+ fi
32+
33+ su - mig -c " PYTHONPATH=/home/mig /home/mig/mig/server/indexdoi.py"
734
835exit 0
You can’t perform that action at this time.
0 commit comments