From: Guido Trotter Date: Fri, 13 Feb 2009 11:18:47 +0000 (+0000) Subject: Add example instance-debootstrap.d file X-Git-Tag: v0.7~7 X-Git-Url: http://git.equinoxoli.org/?p=ext%2Finstance-debootstrap.git;a=commitdiff_plain;h=3f3482cb0d027b2f03633c7afd62884e022d344e Add example instance-debootstrap.d file This configures the eth0 interface for dhcp. Reviewed-by: iustinp --- diff --git a/example/instance-debootstrap.d/interfaces b/example/instance-debootstrap.d/interfaces new file mode 100644 index 0000000..455c396 --- /dev/null +++ b/example/instance-debootstrap.d/interfaces @@ -0,0 +1,53 @@ +#!/bin/bash + +# Copyright (C) 2009 Google Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# This is an example script that configures you /etc/network/interfaces after +# installation. By default its sets up the system to use dhcp. To use it just +# put it in your CUSTOMIZE_DIR and make it executable. + +if [ -z "$TARGET" -o ! -d "$TARGET" ]; then + echo "Missing target directory" + exit 1 +fi + +if [ ! -d "$TARGET/etc/network" ]; then + echo "Missing target network directory" + exit 1 +fi + +if [ -z "$NIC_COUNT" ]; then + echo "Missing NIC COUNT" + exit 1 +fi + +if [ "$NIC_COUNT" -gt 0 ]; then + + cat > $TARGET/etc/network/interfaces <