diff options
Diffstat (limited to 'upstart')
-rw-r--r-- | upstart/cloud-run-user-script.conf | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/upstart/cloud-run-user-script.conf b/upstart/cloud-run-user-script.conf index e50006d4..9a47e57b 100644 --- a/upstart/cloud-run-user-script.conf +++ b/upstart/cloud-run-user-script.conf @@ -7,8 +7,10 @@ console output task script -sdir=/var/lib/cloud/data/scripts -[ -d "$sdir" ] || exit 0 -exec cloud-init-run-module once-per-instance user-scripts execute \ - run-parts --regex '.*' "$sdir" +iid=$(cloud-init-query instance-id) || exit 1 +sdir="/var/lib/cloud/data/scripts/${iid}" +if [ -d "$sdir" ]; then + exec cloud-init-run-module once-per-instance user-scripts execute \ + run-parts --regex '.*' "$sdir" +fi end script |