]> git.ipfire.org Git - ipfire.org.git/blame - src/scripts/ipfire.org.in
ipfire.org: Start async loop before running anything else
[ipfire.org.git] / src / scripts / ipfire.org.in
CommitLineData
d6df53bf 1#!@PYTHON@
940227cb 2
d69bd13a 3import asyncio
c5ddbd67 4import sys
a2e77efa 5import tornado.options
940227cb 6
c5ddbd67 7import ipfire
940227cb 8
d69bd13a
MT
9async def main():
10 backend = ipfire.Backend("@configsdir@/@PACKAGE_NAME@.conf")
3c4f2edc 11
c5ddbd67
MT
12 if len(sys.argv) < 2:
13 sys.stderr.write("Argument needed\n")
14 sys.exit(1)
3c4f2edc 15
a2e77efa
MT
16 # Parse command line arguments
17 args = tornado.options.parse_command_line()
3c4f2edc 18
c5ddbd67 19 # Run the task
d69bd13a 20 await backend.run_task(*args)
940227cb 21
d69bd13a 22asyncio.run(main())