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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
module Test_interfaces =
let conf ="# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo eth0 #foo
allow-hotplug eth1
iface lo inet \
loopback
mapping eth0
script /usr/local/sbin/map-scheme
map HOME eth0-home
map \
WORK eth0-work
iface eth0-home inet static
address 192.168.1.1
netmask 255.255.255.0
bridge_maxwait 0
# up flush-mail
down Mambo #5
iface eth0-work inet dhcp
allow-auto eth1
iface eth1 inet dhcp
mapping eth1
# I like mapping ...
# ... and I like comments
script\
/usr/local/sbin/map-scheme
"
test Interfaces.lns get conf =
{ "#comment" = "This file describes the network interfaces available on your system"}
{ "#comment" = "and how to activate them. For more information, see interfaces(5)." }
{ "#comment" = "The loopback network interface" }
{}
{ "auto"
{ "1" = "lo" }
{ "2" = "eth0" }
{ "3" = "#foo" } }
{ "allow-hotplug" { "1" = "eth1" } }
{ }
{ "iface" = "lo"
{ "family" = "inet"}
{ "method" = "loopback"} {} }
{ "mapping" = "eth0"
{ "script" = "/usr/local/sbin/map-scheme"}
{ "map" = "HOME eth0-home"}
{ "map" = "WORK eth0-work"}
{} }
{ "iface" = "eth0-home"
{ "family" = "inet"}
{ "method" = "static"}
{}
{ "address" = "192.168.1.1" }
{ "netmask" = "255.255.255.0" }
{ "bridge_maxwait" = "0" }
{ "#comment" = "up flush-mail" }
{ "down" = "Mambo #5" }
{} }
{ "iface" = "eth0-work"
{ "family" = "inet"}
{ "method" = "dhcp"}
{} }
{ "auto"
{ "1" = "eth1" } }
{ "iface" = "eth1"
{ "family" = "inet"}
{ "method" = "dhcp"}
{} }
{ "mapping" = "eth1"
{ "#comment" = "I like mapping ..." }
{ "#comment" = "... and I like comments" }
{}
{ "script" = "/usr/local/sbin/map-scheme"} }
test Interfaces.lns put "" after
set "/iface[1]" "eth0";
set "/iface[1]/family" "inet";
set "/iface[1]/method" "dhcp"
= "iface eth0 inet dhcp\n"
|