~thedac/charms/trusty/neutron-gateway/workgroup-status

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
description "Enabling Quantum external networking port"

start on runlevel [2345]

task

script
    devs="{{ devs }}"
    mtu="{{ mtu }}"
    if [ -n "$mtu" ]; then
        tmpfile=`mktemp`
        echo $devs > $tmpfile
        while read -r dev; do
            [ -n "$dev" ] || continue
            rc=0
            # Try all devices before exiting with error
            ip link set $dev mtu $mtu || rc=$?
        done <  $tmpfile
        rm $tmpfile
        [ $rc = 0 ] || exit $rc
    fi
end script