572e558549
Ensure mktmp dir is deleted when no longer needed. Closes-Bug: 1467938
23 lines
494 B
Plaintext
23 lines
494 B
Plaintext
description "Apply MTU for Neutron data ports"
|
|
|
|
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
|