Revision e7cbe965
b/snf-image-helper/common.sh | ||
---|---|---|
159 | 159 |
fi |
160 | 160 |
} |
161 | 161 |
|
162 |
trap cleanup EXIT |
|
162 | 163 |
|
164 |
check_if_excluded() { |
|
163 | 165 |
|
164 |
trap cleanup EXIT |
|
166 |
test "$PROGNAME" = "snf-image-helper" && return 0 |
|
167 |
|
|
168 |
eval local do_exclude=\$SNF_IMAGE_EXCLUDE_${PROGNAME:2}_TASK |
|
169 |
if [ -n "$do_exclude" ]; then |
|
170 |
warn "Task $PROGNAME was excluded and will not run." |
|
171 |
exit 0 |
|
172 |
fi |
|
173 |
|
|
174 |
return 0 |
|
175 |
} |
|
176 |
|
|
177 |
# Check if the execution of a task should be ommited |
|
178 |
check_if_excluded |
|
165 | 179 |
|
166 | 180 |
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai : |
b/snf-image-helper/snf-image-helper.in | ||
---|---|---|
79 | 79 |
# in case it is left mounted... |
80 | 80 |
trap '{ umount "$target"; }' ERR |
81 | 81 |
|
82 |
# Redirect standard error to standard output, |
|
83 |
# prepend a timestamp before each line of output. |
|
84 |
echo "Execute all snf-image tasks...." |
|
85 |
$RUN_PARTS -v --exit-on-error "@tasksdir@" 2>&1| |
|
86 |
while IFS= read -r line; do |
|
87 |
echo $(date +%Y:%m:%d-%H:%M:%S.%N) "$line" |
|
88 |
done |
|
82 |
if [ -z "$SNF_IMAGE_EXCLUDE_ALL_TASKS" ]; then |
|
83 |
# Redirect standard error to standard output, |
|
84 |
# prepend a timestamp before each line of output. |
|
85 |
echo "Execute all snf-image tasks...." |
|
86 |
$RUN_PARTS -v --exit-on-error "@tasksdir@" 2>&1| |
|
87 |
while IFS= read -r line; do |
|
88 |
echo $(date +%Y:%m:%d-%H:%M:%S.%N) "$line" |
|
89 |
done |
|
90 |
fi |
|
89 | 91 |
|
90 | 92 |
# Disable the trap. If code reaches here, the filesystem is unmounted. |
91 | 93 |
trap - ERR |
Also available in: Unified diff