#!/bin/bash -x env > /tmp/antani.env if [ -f /etc/ganeti/common.sh ] ; then . /etc/ganeti/common.sh else exit 0 fi routes=$(gettags $GANETI_INSTANCE_NAME) primary=$(i_am_primary) #IFS=',' for tag in $routes do rtype=`echo $tag | awk -F ':' '{print $1}'` if [ x"$rtype" == x"route" ] ; then route=`echo $tag | awk -F ':' '{print $2":"$3}'` addr=`echo $route | awk -F ':' '{print $1}'` iface=`echo $route | awk -F ':' '{print $2}'` # if [ $primary ] ; then add_route $addr $iface else del_route $addr loc fi fi done v6routes=$(getv6tags $GANETI_INSTANCE_NAME) for tag in $v6routes do rtype=`echo $tag | awk -F '_' '{print $1}'` if [ x"$rtype" == x"v6" ] ; then route=`echo $tag | awk -F '_' '{print $2":"$3}'` addr=`echo $route | awk -F '_' '{print $1}'` iface=`echo $route | awk -F '_' '{print $2}'` # if [ $primary ] ; then add_v6route $addr $iface else del_v6route $addr $iface fi echo $route fi done #unset IFS