| 1 |
#! /bin/sh
|
| 2 |
|
| 3 |
error=0 ; trap "error=$((error|1))" ERR
|
| 4 |
|
| 5 |
fcopy -i /etc/hosts.equiv /etc/hosts.allow /etc/hosts.deny
|
| 6 |
|
| 7 |
if ifclass DHCPC
|
| 8 |
then
|
| 9 |
cat > $target/etc/network/interfaces <<-EOF
|
| 10 |
# generated by FAI
|
| 11 |
auto lo eth0
|
| 12 |
iface lo inet loopback
|
| 13 |
iface eth0 inet dhcp
|
| 14 |
EOF
|
| 15 |
else
|
| 16 |
cat > $target/etc/network/interfaces <<-EOF
|
| 17 |
# generated by FAI
|
| 18 |
auto lo eth0
|
| 19 |
iface lo inet loopback
|
| 20 |
iface eth0 inet static
|
| 21 |
address $IPADDR
|
| 22 |
netmask $NETMASK
|
| 23 |
broadcast $BROADCAST
|
| 24 |
gateway $GATEWAYS
|
| 25 |
EOF
|
| 26 |
echo "localnet $NETWORK" > $target/etc/networks
|
| 27 |
[ -s /tmp/etc/resolv.conf ] && cp -p /tmp/etc/resolv.conf $target/etc
|
| 28 |
fcopy -i /etc/resolv.conf
|
| 29 |
fi
|
| 30 |
|
| 31 |
# here fcopy is mostly used, when installing a client for running in a
|
| 32 |
# different subnet than during the installation
|
| 33 |
fcopy -iM /etc/network/interfaces /etc/networks
|
| 34 |
|
| 35 |
exit $error
|