#! /usr/bin/awk -f # Add default IPv4 route to the output of sipcalc(1) # Copyright (C) 2009 Matous Jan Fialka, # Released under the terms of The MIT License # # Usage: sipcalc [/] | sipcalc-adr.awk # This script is specific for the company I work! { print } /^Network mask \(bits\)/ { ntype = $5 < 31 ? $5 == 30 : -1 } /^Usable range/ { printf "Default route\t\t- " if (ntype == 0) print $6 else if (ntype == 1) print $4 }