diff options
| author | Franck Cuny <franck@fcuny.net> | 2024-10-05 10:34:31 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2024-10-05 10:34:31 -0700 |
| commit | c4b455e7a6048151806dcc9f45844c1b43de06e8 (patch) | |
| tree | 9b83174f54207fc9d09073f46f5c93e3ae0e31cb /src/cli/ipconverter.py | |
| parent | enable tmux (diff) | |
| download | infra-c4b455e7a6048151806dcc9f45844c1b43de06e8.tar.gz | |
more scripts to delete
Diffstat (limited to 'src/cli/ipconverter.py')
| -rwxr-xr-x | src/cli/ipconverter.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/cli/ipconverter.py b/src/cli/ipconverter.py deleted file mode 100755 index 4e6906b..0000000 --- a/src/cli/ipconverter.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 - -""" -Utility to convert an IPv4 address to an int, or an int to an IPv4 address. -""" - -import ipaddress - -import click - - -@click.command() -@click.argument("ips", nargs=-1, type=int) -def int2ip(ips): - for ip in ips: - convip = ipaddress.ip_address(ip) - print(f"{ip} → {convip}") - - -@click.command() -@click.argument("ips", nargs=-1, type=str) -def ip2int(ips): - for ip in ips: - convip = int(ipaddress.ip_address(ip)) - print(f"{ip} → {convip}") |
