This commit is contained in:
parent
28eb3f023c
commit
103c213583
1 changed files with 47 additions and 0 deletions
47
scripts/list-all-ips
Executable file
47
scripts/list-all-ips
Executable file
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/env python3
|
||||
from os import environ
|
||||
from sys import argv
|
||||
|
||||
from bundlewrap.repo import Repository
|
||||
from bundlewrap.utils.dicts import merge_dict
|
||||
|
||||
|
||||
path = environ.get('BW_REPO_PATH', '.')
|
||||
repo = Repository(path)
|
||||
|
||||
|
||||
if len(argv) > 1:
|
||||
ips = {}
|
||||
for i in argv[1:]:
|
||||
ips = merge_dict(ips, repo.libs.tools.resolve_identifier(repo, i))
|
||||
else:
|
||||
ips = repo.libs.tools.resolve_identifier(repo, 'all')
|
||||
|
||||
|
||||
if ips['ipv4']:
|
||||
# editorconfig-checker-disable
|
||||
print(''' ________ __ __
|
||||
/ _/ __ \\_ __/ // /
|
||||
/ // /_/ / | / / // /_
|
||||
_/ // ____/| |/ /__ __/
|
||||
/___/_/ |___/ /_/''')
|
||||
# editorconfig-checker-enable
|
||||
|
||||
for ip in sorted(ips['ipv4']):
|
||||
print(ip)
|
||||
|
||||
if ips['ipv4'] and ips['ipv6']:
|
||||
# some space inbetween
|
||||
print()
|
||||
|
||||
if ips['ipv6']:
|
||||
# editorconfig-checker-disable
|
||||
print(''' ________ _____
|
||||
/ _/ __ \\_ __/ ___/
|
||||
/ // /_/ / | / / __ \\
|
||||
_/ // ____/| |/ / /_/ /
|
||||
/___/_/ |___/\\____/''')
|
||||
# editorconfig-checker-enable
|
||||
|
||||
for ip in sorted(ips['ipv6']):
|
||||
print(ip)
|
Loading…
Reference in a new issue