#!/bin/bash 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 %> # Uncomment to use extract_scripts and use app/scripts <%%=# extract_scripts(to: "/opt") %> <%%= yield %> uptime | tee /var/log/boot-time.log