#!/bin/sh . /var/lib/inet2/inet2.sh escapebird() { sed -e 's/\\/\\\\/g;s/"/\\"/g' } step "Creating Bird configuration" touch /var/log/bird.log chown bird:bird /var/log/bird.log interfacelist=$( echo " interface \"lo\" { stub; };" getval interface | while read -r inter; do val="$(getval "interface $inter" OSPF)" if [ "$?" = "0" ]; then echo " interface \"$(printf "%s" "$inter" | escapebird)\" {" echo " type ptp;" if [ -n "$val" ]; then echo " $val;"; fi echo " };" fi done ) filter4=$(getval "Subnet" | grep -v ':' | while read -r line; do printf "%s+," "$line"; done | sed 's/,$//') filter6=$(getval "Subnet" | grep ':' | while read -r line; do printf "%s+," "$line"; done | sed 's/,$//') (cat < /etc/bird.conf chown root:bird /etc/bird.conf chmod 640 /etc/bird.conf