Added ping()
Added ping() Added ping() Added ping() Added ping() Added ping() Added ping() Added ping() Added ping()
This commit is contained in:
parent
386299ce57
commit
cc483abd29
1 changed files with 12 additions and 0 deletions
|
|
@ -28,6 +28,18 @@ def is_connected():
|
|||
# Else
|
||||
return False
|
||||
|
||||
|
||||
def ping(addr='google.com'):
|
||||
"""Attempt to ping addr."""
|
||||
cmd = (
|
||||
'ping',
|
||||
'-n' if psutil.WINDOWS else '-c',
|
||||
'2',
|
||||
addr,
|
||||
)
|
||||
run_program(cmd)
|
||||
|
||||
|
||||
def show_valid_addresses():
|
||||
"""Show all valid private IP addresses assigned to the system."""
|
||||
devs = psutil.net_if_addrs()
|
||||
|
|
|
|||
Loading…
Reference in a new issue