4bf2ed235583756b013a1fdd6aabb675281efe85
[automated-distro-installer] / fai / config / scripts / FAISERVER / 10-conffiles
1 #! /bin/bash
2
3 fcopy -Bvr /etc/fai
4 fcopy -Bv /etc/fai/apt/sources.list /etc/dhcp/dhcpd.conf
5 fcopy -v /etc/rc.local
6
7 if [ $FAI_ACTION = "install" ]; then
8
9 # use the same sources.list for the server itself and the clients
10 cp -a $target/etc/fai/apt $target/etc/
11
12 if ifclass DHCPC; then
13 rm -f $target/etc/resolv.conf
14 else
15 echo 127.0.0.1 > $target/etc/resolv.conf
16 fi
17
18 # faiserver uses its own apt cache
19 ainsl -av /etc/apt/apt.conf.d/02proxy 'Acquire::http::Proxy "http://127.0.0.1:3142";'
20
21 # create some host entries
22 myip=$(ip addr show up| grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1 | grep -v 127.0.0.1)
23 ainsl /etc/hosts "$myip faiserver" # that's me
24 ainsl /etc/hosts "192.168.33.100 demohost"
25 ainsl /etc/hosts "192.168.33.101 xfcehost"
26 # add entries for 10 hosts called client 01 .. 10
27 perl -e 'for (1..10) {printf "192.168.33.%s client%02s\n",101+$_,$_;}' >> $target/etc/hosts
28
29 sed -i -e '/# ReuseConnections: 1/d' $target/etc/apt-cacher-ng/acng.conf
30 ainsl -v /etc/apt-cacher-ng/acng.conf "ReuseConnections: 0"
31
32 # copy base file for faster building of nfsroot
33 cp -p /var/tmp/base.tar.xz $target/var/tmp
34
35 if [ -d /media/mirror/pool ]; then
36 mkdir $target/var/cache/apt-cacher-ng/_import
37 cp -p /media/mirror/pool/*/*/*/*.deb $target/var/cache/apt-cacher-ng/_import
38 $ROOTCMD chown -R apt-cacher-ng.apt-cacher-ng /var/cache/apt-cacher-ng/_import
39 fi
40
41 # copy basefiles from CD to config space
42 if [ -d $FAI/basefiles ]; then
43 mkdir -p $target/srv/fai/config/basefiles
44 cp -vp $FAI/basefiles/*.tar.* $target/srv/fai/config/basefiles 2>/dev/null
45 fi
46 fi