File tree Expand file tree Collapse file tree 2 files changed +54
-2
lines changed
tests/fixture/confs-stdlocal Expand file tree Collapse file tree 2 files changed +54
-2
lines changed Original file line number Diff line number Diff line change 22#
33# run importdoi 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+
510# Add any custom domains to lookup DOIs for here and format according to
611# https://support.datacite.org/docs/api-queries
712# where we simply filter on our own FQDN in the registered DOI url.
813doi_fqdn=" url:__PUBLIC_ALIAS_FQDN__"
914
1015# No more edits below
11- su - mig -c " PYTHONPATH=__MIG_BASE__ mig/server/importdoi.py $doi_fqdn "
16+ check_enabled () {
17+ su - mig -c " PYTHONPATH=__MIG_BASE__ __MIG_CODE__/server/chkenabled.py $1 " >& /dev/null
18+ }
19+ check_set () {
20+ VALUE=$( su - mig -c " PYTHONPATH=__MIG_BASE__ __MIG_CODE__/server/readconfval.py $1 " )
21+ if [ -z " $VALUE " ]; then
22+ # echo "DEBUG: $1 not set in MiGserver conf - skipping"
23+ return 1
24+ fi
25+ return 0
26+ }
27+
28+ if ! check_enabled " freeze" ; then
29+ # echo "DEBUG: nothing to do with freeze disabled"
30+ exit 0
31+ fi
32+ if ! check_set " site_freeze_doi_url" ; then
33+ # echo "DEBUG: nothing to do with freeze doi url disabled"
34+ exit 0
35+ fi
36+
37+ su - mig -c " PYTHONPATH=__MIG_BASE__ __MIG_CODE__/server/importdoi.py $doi_fqdn "
1238
1339exit 0
Original file line number Diff line number Diff line change 22#
33# run importdoi 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+
510# Add any custom domains to lookup DOIs for here and format according to
611# https://support.datacite.org/docs/api-queries
712# where we simply filter on our own FQDN in the registered DOI url.
813doi_fqdn=" url:"
914
1015# No more edits below
11- su - mig -c " PYTHONPATH=/home/mig mig/server/importdoi.py $doi_fqdn "
16+ check_enabled () {
17+ su - mig -c " PYTHONPATH=/home/mig /home/mig/mig/server/chkenabled.py $1 " >& /dev/null
18+ }
19+ check_set () {
20+ VALUE=$( su - mig -c " PYTHONPATH=/home/mig /home/mig/mig/server/readconfval.py $1 " )
21+ if [ -z " $VALUE " ]; then
22+ # echo "DEBUG: $1 not set in MiGserver conf - skipping"
23+ return 1
24+ fi
25+ return 0
26+ }
27+
28+ if ! check_enabled " freeze" ; then
29+ # echo "DEBUG: nothing to do with freeze disabled"
30+ exit 0
31+ fi
32+ if ! check_set " site_freeze_doi_url" ; then
33+ # echo "DEBUG: nothing to do with freeze doi url disabled"
34+ exit 0
35+ fi
36+
37+ su - mig -c " PYTHONPATH=/home/mig /home/mig/mig/server/importdoi.py $doi_fqdn "
1238
1339exit 0
You can’t perform that action at this time.
0 commit comments