6 cat <<EOF >> "$LXC_CONFIG_FILE"
9 lxc.network.type = veth
10 lxc.network.flags = up
11 lxc.network.link = brData
12 lxc.network.name = eth1
13 lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//')
15 lxc.network.type = veth
16 lxc.network.flags = up
17 lxc.network.link = brPublic
18 lxc.network.name = eth2
19 lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//')
22 USERDATA="$LXC_ROOTFS_PATH/var/lib/cloud/seed/nocloud-net/user-data"
24 additional_interfaces="
26 cat <<EOF >> /etc/network/interfaces.d/additional-interfaces
27 ## added by juju charm
28 ## those interfaces will be brought up by the upstart job as /etc/init/additional-interfaces.conf
36 - machine_agent=\$(hostname | sed -e 's/^juju-/jujud-/')
38 cat <<EOF > /etc/init/additional-interfaces.conf
39 ## added by juju charm
41 start on started \${machine_agent}
45 ifup -a -i /etc/network/interfaces.d/additional-interfaces
49 additional_interfaces=$(echo "$additional_interfaces" | sed -e 's/$/\\n/' | tr -d '\n')
51 sed -i.orig -e "s@^runcmd:@\0$additional_interfaces@" \