File: netbase.postinst

package info (click to toggle)
netbase 6.5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 160 kB
  • sloc: sh: 61; makefile: 15
file content (36 lines) | stat: -rw-r--r-- 522 bytes parent folder | download
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
#!/bin/sh -e

create_hosts_file() {
  if [ -e /etc/hosts ]; then return 0; fi

  cat > /etc/hosts <<-EOF
	127.0.0.1	localhost
	::1		localhost ip6-localhost ip6-loopback
	ff02::1		ip6-allnodes
	ff02::2		ip6-allrouters

EOF
}

create_networks_file() {
  if [ -e /etc/networks ]; then return 0; fi

  cat > /etc/networks <<-EOF
	default		0.0.0.0
	loopback	127.0.0.0
	link-local	169.254.0.0

EOF
}

case "$1" in
    configure)
    if [ -z "$2" ]; then
	create_hosts_file
	create_networks_file
    fi
    ;;
esac

#DEBHELPER#