-
Notifications
You must be signed in to change notification settings - Fork 12
/
airshipd
executable file
·35 lines (27 loc) · 906 Bytes
/
airshipd
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
#!/usr/bin/env python
import airship
import sys
import argparse
from groundstation.node import Node
from groundstation.station import Station
import groundstation.utils.pid
myself = Node()
station = Station.from_env(myself)
def _create_option_parser():
parser = argparse.ArgumentParser()
parser.add_argument("--host", dest='host', action='store')
parser.add_argument("--keyname", dest='key', action='store')
parser.add_argument("--pidfile", dest='pidfile', action='store',
default=False)
return parser
def main(argv):
parser = _create_option_parser()
args = parser.parse_args(argv[1:])
app = airship.make_airship(station)
if args.pidfile:
groundstation.utils.pid.register_pidfile(args.pidfile)
if args.key:
app.set_signing_key(args.key)
app.run(args.host, 9005, True)
if __name__ == "__main__":
main(sys.argv)