-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathget_status.py
executable file
·39 lines (32 loc) · 994 Bytes
/
get_status.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
from sys import exit
from airos import AirOS
from pprint import pprint
from argparse import ArgumentParser
def main(host=None, username=None, password=None):
station = AirOS(host=host, username=username, password=password)
status = station.status
pprint(status, indent=3)
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument(
action='store',
dest='host',
help='The address or hostname of your device.',
)
parser.add_argument(
'-u', '--username',
action='store',
default='ubnt',
dest='username',
help='The username to access the AirOS status page.',
)
parser.add_argument(
'-p', '--password',
action='store',
default='ubnt',
dest='password',
help='The password to access the AirOS status page.',
)
args = parser.parse_args()
main(host=args.host, username=args.username, password=args.password)