github.com/geofffranks/garden-linux@v0.0.0-20160715111146-26c893169cfa/linux_backend/bin/rootfs/setup.sh (about)

     1  #!/bin/bash
     2  
     3  [ -n "$DEBUG" ] && set -o xtrace
     4  set -o nounset
     5  set -o errexit
     6  shopt -s nullglob
     7  shopt -s globstar
     8  
     9  if [ ! -f /etc/issue ]
    10  then
    11    echo "/etc/issue doesn't exist; cannot determine distribution"
    12    exit 1
    13  fi
    14  
    15  if grep -q -i ubuntu /etc/issue
    16  then
    17    exec $(dirname $0)/ubuntu.sh $@
    18  fi
    19  
    20  if grep -q -i centos /etc/issue
    21  then
    22    exec $(dirname $0)/centos.sh $@
    23  fi
    24  
    25  echo "Unknown distribution: $(head -1 /etc/issue)"
    26  exit 1