#!/usr/local/bin/bash
#
# Copyright (c) 2016 Joyent Inc., All rights reserved.

# Log output
LOG='/var/log/triton.log'
if [[ ! -e $LOG ]] ; then
  touch $LOG
fi

exec 4<> $LOG
export PS4='[\D{%FT%TZ}] ${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
export BASH_XTRACEFD=4
set -o xtrace

(/usr/local/lib/smartdc/add-network-interface)
(/usr/local/lib/smartdc/set-hostname)
(/usr/local/lib/smartdc/set-root-authorized-keys)
if [ ! -f /usr/local/lib/smartdc/.firstboot-complete-do-not-delete ] ; then
  (/usr/local/lib/smartdc/firstboot)
fi
(/usr/local/lib/smartdc/run-operator-script)
(/usr/local/lib/smartdc/get-user-data)
(/usr/local/lib/smartdc/run-user-script)
