# REVERSE-IP.RC # # This function reverses an IP's quads, so that you can then # look the IP up on a dns-based blocklist or whitelist. # :0 * $ ! LOCALIP ?? 000.000.000.000 * LOCALIP ?? ()\/[0-9][0-9]?[0-9]? { QUAD1=${MATCH} } :0 * LOCALIP ?? [0-9][0-9]?[0-9]?\.\/[0-9][0-9]?[0-9]? { QUAD2=${MATCH} } :0 * LOCALIP ?? [0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.\/[0-9][0-9]?[0-9]? { QUAD3=${MATCH} } :0 * LOCALIP ?? [0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.\/[0-9][0-9]?[0-9]? { QUAD4=${MATCH} } :0 { LOCALREVIP="${QUAD4}.${QUAD3}.${QUAD2}.${QUAD1}" }