128
  5   )ˆl–Ðz¾””Ð?Je@³p/ÜlJbÑ¿�þ\tk7)x@eâ” þÖƒ�½ÕÁÒ z    )#! /usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
#
# This is simple script to process JSON output from ip route
# command and format it.  Based on earlier shell script version.
"""Script to parse ip route output into more readable text."""

import sys
import json
import getopt
import subprocess


def usage():
    '''Print usage and exit'''
    print("Usage: {} [tablenr [raw ip args...]]".format(sys.argv[0]))
    sys.exit(64)


def main():
    '''Process the arguments'''
    family = 'inet'
    try:
        opts, args = getopt.getopt(sys.argv[1:], "h46f:", ["help", "family="])
    except getopt.GetoptError as err:
        print(err)
        usage()

    for opt, arg in opts:
        if opt in ["-h", "--help"]:
            usage()
        elif opt == '-6':
            family = 'inet6'
        elif opt == "-4":
            family = 'inet'
        elif opt in ["-f", "--family"]:
            family = arg
        else:
            assert False, "unhandled option"

    if not args:
        args = ['0']

    cmd = ['ip', '-f', family, '-j', 'route', 'list', 'table'] + args
    process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
    tbl = json.load(process.stdout)
    if family == 'inet':
        fmt = '{:15} {:15} {:15} {:8} {:8}{:<16} {}'
    else:
        fmt = '{:32} {:32} {:32} {:8} {:8}{:<16} {}'

    # ip route json keys
    keys = ['dst', 'gateway', 'prefsrc', 'protocol', 'scope', 'dev', 'table']
    print(fmt.format(*map(lambda x: x.capitalize(), keys)))

    for record in tbl:
        fields = [record[k] if k in record else '' for k in keys]
        print(fmt.format(*fields))


if __name__ == "__main__":
    main()
  5   +ˆl–ß=¿J
j"T% íÆ^¸ÛÊbÑ¿�þZz5›,n‰ÈÀë�<ç×ƒ\gÖÂÓ ‹    +#!/bin/sh
# Written by Thomas Esser.  Public domain.
# Execute texi2dvi --pdf.

test -f /bin/ksh && test -z "$RUNNING_KSH" \
  && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \
  && { RUNNING_KSH=true; export RUNNING_KSH; exec /bin/ksh $0 ${1+"$@"}; }
unset RUNNING_KSH

test -f /bin/bsh && test -z "$RUNNING_BSH" \
  && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \
  && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; }
unset RUNNING_BSH

# hack around a bug in zsh:
test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'

# special-case --version following GNU standards for identifying the
# program name.  If --version is specified as other than the first
# argument, we don't output the standard name, but then, we're not
# obliged to.
if test "x$1" = x--version; then
  cat <<EOF
texi2pdf (GNU Texinfo 6.8)

Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
EOF
  exit 0
fi

texi2dvi --pdf ${1+"$@"}
     -ˆÑÐÖ706ÏÂÓ Â    -‹      Å—]o›0†ïû+<.vNB¾Ö–0Q`+ZH" šªiªv‚U‚v—u¿~æ£m:5ë¦!v•sÌŸ÷9Øô7öÒ
¯Wº½9Z]]Ì])=€ÏCÀíúÂHí œ…‚”Dˆü`¿ß«û¡ÊŠ-„>$b—Ž€‹‚ÆBÅ+Æ‰^Ž'HOH„å/Ò)1Ü“ïˆm°;Á)&ræün�Òøa 0Ûqà$Ãš“S®ÆŒå²f1ïqž>¨G�,‘²N�“tcRº†”ÅQJ`Ío.LêúÒ4–ô5Ã÷¥ÓÁt%‹WÍ‰Ö•¹2,]$è[”Òm6SËC§»-âE<S€Æ,ã°N£ìVÝÒ�‚¢TÌ”/®µü*u²dùoC��¬½™)ï­Ùâ|9³cíˆÑËOjLÅ˜G\ ÃtC	>*jq@ŸÐ®56áqAsAYö$‰xˆ³”ç‘dK‚¤8TÕüZ7¢øY3V¦ï,BÛõë–àrŠ'wÝÝcÅXEÉ²iAbÁŠû¦	µ£·Ùšçç)jºM„b ÔC/*ÿ¢/wÙmÆöÙakdÛ_lÊÜº1mÛw‚@®‚ÇøÐî/þ´¾6éõG=mŠ4íl0Bèˆp0Õ:±–ó¹:H·‚´Ñ§ŽAÊ³¹Æ(£6 ´ÓqÇ®-÷¢ûÁµÌÐ].*šçCm`Ç“Ž™ç˜Á•ïx’¤b:ÈÛYlïþhÃRLŠCžcGbå?Ì�N M“½Ê2î¦¨?9÷�³t~”yË…šþuÍÒ$-mŸŽQ¦WeÐÊÊšL»F¸òßµjŠ:nd|Ú1ÈÊ\9~…QE­@»†�¹³º”{¢yÌÚ¹#]/­ÐmvG´ò Q¿y>þáK+4¯ó:TŸ:ÔC?`É]o       /ˆÑÐÖ604ÏÂÓ \    /‹      ½•aoš@Æß÷SÜîÅÞÁ!Uk-²¨�ÊªhÒÖeiN8ä*pìîªµŸ~(.º¥¦3[úŠžç¹ÿó#9ŒOÖ°ë=ŒlÐó}0ò;}§ ‚ÐÝy!Ë³ÊUU« d»ÀXÊ¼‰ÐjµRWç*ãsä�Q,Ó¤Š„ä4�j(Chž›gæ0b‚Ãâ
IeBL'É`@ìY
’"Y¦9
p„… R ‘s,6«e±µª!gi Ò_$¢]¤1cáz³SåRóv8<Û†o–Ü4d–8¡ó¬%Ë¡iÐtZÑ€eÍœ-Ô9� À‰lÁoNwø½Ð!oÜ¦�AÌIÔ‚_º-÷jØjCÓÅ)1~[3(44ûXH�²�F”„GÅ“2pB_�Z¥Æ""à4—”e{)**VX"r\t­b~¨*%á{4pðŒQ{l»žåŒK$á&b?ÝIßš