#!/bin/sh

export PATH=/opt/chef/embedded/bin:$PATH
export HOME=<%= node[:berkshelf_api][:deploy_path] %>
cd $HOME

exec 2>&1
exec chpst -u <%= node[:berkshelf_api][:owner] %> bundle exec bin/berks-api -h <%= node[:berkshelf_api][:app_host] %> -p <%= node[:berkshelf_api][:port] %> -c <%= node[:berkshelf_api][:config_path] %>
