File: 10-conffiles

package info (click to toggle)
fai 6.5.4
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,076 kB
  • sloc: sh: 6,720; perl: 5,626; makefile: 138
file content (51 lines) | stat: -rwxr-xr-x 1,825 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /bin/bash

fcopy -BvrS /etc/fai
fcopy -BvS /etc/dhcp/dhcpd.conf

if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then

    # use the same sources.list for the server itself and the clients
    cp -a $target/etc/fai/apt $target/etc/

    if ifclass DHCPC; then
	rm -f $target/etc/resolv.conf
    else
	echo 127.0.0.1 > $target/etc/resolv.conf
    fi

    # faiserver uses its own apt cache
    ainsl -av /etc/apt/apt.conf.d/02proxy 'Acquire::http::Proxy "http://127.0.0.1:3142";'

    # create some host entries
    _nic=$(ip route | awk '/^default/ {print $5}'|head -1)
    myip=$(ip -br ad sh $_nic | awk '{print $3}')
    myip=${myip%/*}
    ainsl /etc/hosts "$myip faiserver"  # that's me
    ainsl /etc/hosts "192.168.33.100 demohost"
    ainsl /etc/hosts "192.168.33.101 xfcehost"
    # add entries for 10 hosts called client 01 .. 10
    perl -e 'for (1..10) {printf "192.168.33.%s client%02s\n",101+$_,$_;}' >> $target/etc/hosts

    fai-sed '/# ReuseConnections: 1/d' /etc/apt-cacher-ng/acng.conf
    ainsl -v /etc/apt-cacher-ng/acng.conf "ReuseConnections: 1"
    ainsl -v /etc/apt-cacher-ng/acng.conf "PipelineDepth: 80"
    ainsl -v /etc/apt-cacher-ng/acng.conf "DlMaxRetries: 6"

    # copy base file for faster building of nfsroot
    if [ -f /var/tmp/base.tar.xz ]; then
	cp -p /var/tmp/base.tar.xz $target/var/tmp
    fi

    if [ -d /media/mirror/pool ]; then
	mkdir $target/var/cache/apt-cacher-ng/_import
	cp -p /media/mirror/pool/*/*/*/*.deb $target/var/cache/apt-cacher-ng/_import
	$ROOTCMD chown -R apt-cacher-ng:apt-cacher-ng  /var/cache/apt-cacher-ng/_import
    fi

    # copy basefiles from CD to config space
    if [ -d $FAI/basefiles ]; then
	mkdir -p $target/srv/fai/config/basefiles
	cp -vp $FAI/basefiles/*.tar.* $target/srv/fai/config/basefiles 2>/dev/null || true
    fi
fi