#!/bin/bash -exu export HOME=/root # In user-data env USER=root but HOME is not set cd ~ # user-data starts off in / so go to $HOME <%%= add_ssh_key %> <% if options[:s3_folder] -%> <%%= extract_scripts(to: "/opt") %> <% else -%> # Uncomment to use extract_scripts and use app/scripts <%%# extract_scripts(to: "/opt") %> <% end -%> <%%= yield %> uptime | tee /var/log/boot-time.log