#! /bin/basherror=0;trap'error=$(($?>$error?$?:$error))' ERR # save maximum error codeif ifclass DHCPC &&[$FAI_ACTION="install"-o$FAI_ACTION="dirinstall"]thencat>$target/etc/network/interfaces <<-EOF # generated by FAI auto lo $NIC1 iface lo inet loopback iface $NIC1 inet dhcpEOFelif[$FAI_ACTION="install"-o$FAI_ACTION="dirinstall"]then[-n"$IPADDR"]&&cat>$target/etc/network/interfaces <<-EOF # generated by FAI auto lo $NIC1 iface lo inet loopback iface $NIC1 inet static address $IPADDR netmask $NETMASK broadcast $BROADCAST gateway $GATEWAYSEOF[-n"$NETWORK"]&&echo"localnet $NETWORK">$target/etc/networksif[!-L$target/etc/resolv.conf -a-e /etc/resolv.conf ];thencp -p /etc/resolv.conf $target/etcfifi# here fcopy is mostly used, when installing a client for running in a# different subnet than during the installationfcopy -iM /etc/resolv.conffcopy -iM /etc/network/interfaces /etc/networksexit$error