#! /bin/bash

#
# A wrapper script used by upstart configuration files converted
# by add-upstart-service.
#
# When called with no command line arguments, it starts /bin/sh of the guest.
# When started with command line arguments, the first argument is the name of
# a program to run and the following ones are treated as arguments to that
# program. In both cases the script sets the working directory to the root of
# the guest file system.
#
# This script is intended for use only by upstart scripts generated
# by add-upstart-service. Do not use it directly.
#
# Copyright (c) 2013 "Elbrus Technologies" LLC. All rights reserved.
#
# This script comes with NO warranty, not even for MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
#

. /etc/exagear.conf

if [ $# -gt 0 ] ; then
    (
      exagear  -- "$@"
    )
    exit $?
fi

(
  exagear -- /bin/sh
)
exit $?
