added inital isntall for gmg, no configfile yet
[fai-configs.git] / scripts / FAIBASE / 30-interface
CommitLineData
2d1f8014 1#! /bin/bash
2
dce19462 3error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
2d1f8014 4
844fa3d5 5if ifclass DHCPC && [ $FAI_ACTION = "dirinstall" ]
2d1f8014 6then
7 cat > $target/etc/network/interfaces <<-EOF
8 # generated by FAI
dce19462 9 auto lo $NIC1
2d1f8014 10 iface lo inet loopback
dce19462 11 iface $NIC1 inet dhcp
2d1f8014 12EOF
844fa3d5 13elif [ $FAI_ACTION = "dirinstall" ]
2d1f8014 14then
15 [ -n "$IPADDR" ] && cat > $target/etc/network/interfaces <<-EOF
16 # generated by FAI
dce19462 17 auto lo $NIC1
2d1f8014 18 iface lo inet loopback
dce19462 19 iface $NIC1 inet static
2d1f8014 20 address $IPADDR
21 netmask $NETMASK
2d1f8014 22 gateway $GATEWAYS
23EOF
24 [ -n "$NETWORK" ] && echo "localnet $NETWORK" > $target/etc/networks
dce19462 25 [ -L $target/etc/resolv.conf ] || cp -p /etc/resolv.conf $target/etc
2d1f8014 26fi
27
28# here fcopy is mostly used, when installing a client for running in a
dce19462
RR
29# different subnet than during the installation
30fcopy -iM /etc/resolv.conf
2d1f8014 31fcopy -iM /etc/network/interfaces /etc/networks
32
33exit $error