diff options
author | Karel Kočí <karel.koci@nic.cz> | 2018-10-15 10:26:49 +0200 |
---|---|---|
committer | Karel Kočí <karel.koci@nic.cz> | 2018-10-15 10:26:49 +0200 |
commit | e112f6e0e849fcc0849bff78d7791a1e56c62f7c (patch) | |
tree | 3dff2008c6edfb174bdee10622d9ea792c8b2a19 | |
parent | d7d5ba1e6aa10a6cae3ba956a00caecdc1452cbc (diff) | |
download | laminar-cnf-e112f6e0e849fcc0849bff78d7791a1e56c62f7c.tar.gz laminar-cnf-e112f6e0e849fcc0849bff78d7791a1e56c62f7c.tar.bz2 laminar-cnf-e112f6e0e849fcc0849bff78d7791a1e56c62f7c.zip |
Improve job.common
-rw-r--r-- | job.common | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -1,5 +1,11 @@ # vim: ft=sh set -e +# Ensure niceness at least 10 +if [ "$(nice)" -lt 10 ]; then + exec nice "$0" "$@" +fi + +# Use fake laminar in case of external execution if [ -z "$WORKSPACE" ]; then . "$(dirname "$(readlink -f "$0")")/../fakelaminar" fi @@ -9,17 +15,20 @@ if [ -z "$LAMINAR_COMMON" ]; then export LAMINAR_COMMON=y # Job and template id - export JOBID="$(basename "$0" | sed 's/\.run$//')" - export TEMPLATEID="$(basename "$(readlink -f "$0")" | sed 's/\.run$//')" + JOBID="$(basename "$0" | sed 's/\.run$//')" + TEMPLATEID="$(basename "$(readlink -f "$0")" | sed 's/\.run$//')" + export JOBID TEMPLATEID # Template workspace - export TWORKSPACE="$HOME/workspace/$TEMPLATEID" + TWORKSPACE="$HOME/workspace/$TEMPLATEID" if [ "$JOBID" = "$TEMPLATEID" ]; then TWORKSPACE="$HOME/workspace/notemplate" fi + export TWORKSPACE # Files directory - export FILES="$(readlink -f "$(dirname "$(readlink -f "$0")")/../files")" + FILES="$(readlink -f "$(dirname "$(readlink -f "$0")")/../files")" + export FILES fi |