github.com/cloudfoundry-attic/garden-linux@v0.333.2-candidate/linux_backend/bin/create.sh (about)

     1  #!/bin/bash
     2  
     3  [ -n "$DEBUG" ] && set -o xtrace
     4  set -o xtrace
     5  set -o nounset
     6  set -o errexit
     7  shopt -s nullglob
     8  
     9  cd $(dirname "${0}")/..
    10  
    11  if [ $# -ne 1 ]; then
    12    echo "Usage: ${0} <instance_path>"
    13    exit 1
    14  fi
    15  
    16  target=${1}
    17  
    18  if [ ! -d ${target} ]; then
    19    echo "\"${target}\" does not exist, aborting..."
    20    exit 1
    21  fi
    22  
    23  cp -r skeleton/* "${target}"/.
    24  ln -s `pwd`/bin/wshd "${target}"/bin/
    25  ln -s `pwd`/bin/iodaemon "${target}"/bin/
    26  ln -s `pwd`/bin/wsh "${target}"/bin/
    27  ln -s `pwd`/bin/tar "${target}"/bin/
    28  ln -s `pwd`/bin/nstar "${target}"/bin/
    29  
    30  unshare -m "${target}"/setup.sh
    31  echo ${target}