#!/bin/bash
echo|awk '{printf "%-34s%-20s%s\n","Source IP and group","Incoming Interface","Outgoing Interfaces"}'
echo|awk '{printf "%-34s%-20s%s\n","---------------------------------","------------------","------------------------"}'
ip mroute | sed 's/,[ ]/,/; s/Oifs://; s/Iif://; s/[ ][ ]*/ /g' > /tmp/run/mroute_tmp
awk '
    {user_if["pimreg"]="register_vif"}
    NR==FNR {user_if[$2]=$1}
    NR>FNR {
        printf "%-34s%-20s",$1,user_if[$2];
        for (x=3; x<=NF; x++) {
            printf user_if[$x]" "
        };
        print ""
    }' /tmp/run/vlan_interfaces /tmp/run/mroute_tmp
exit 0
