Fix various bugs in snf-image-helper
[snf-image] / snf-image-helper / tasks / 50EnforcePersonality.in
1 #! /bin/bash
2
3 ### BEGIN TASK INFO
4 # Provides:             EnforcePersonality
5 # RunBefore:            UmountImage
6 # RunAfter:             DeleteSSHKeys
7 # Short-Description:    Inject files to the instance
8 ### END TASK INFO
9
10 set -e
11 set -o pipefail
12
13 . "@commondir@/common.sh"
14
15 if [ ! -d "$SNF_IMAGE_TARGET" ]; then
16     log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"
17 fi
18
19 if [ -n "$SNF_IMAGE_PERSONALITY" ]; then
20     echo "$SNF_IMAGE_PERSONALITY" |
21         @scriptsdir@/inject-files.py "$SNF_IMAGE_TARGET"
22 else
23     warn "This image has no personality (0 files to inject)\n"
24 fi
25
26 exit 0
27
28 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
29