-
Notifications
You must be signed in to change notification settings - Fork 0
/
modum
executable file
·29 lines (27 loc) · 932 Bytes
/
modum
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
#!/usr/bin/env python
import argparse
from daemonize import Daemonize
from lib.bot import Modum, __version__
desc = 'Modum, a gevent-based pluginised python IRC bot!'
pid = '/tmp/modum.pid'
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=desc)
parser.add_argument('-d', '--daemon',
action='store_true',
help='Run as a daemon')
parser.add_argument('-c', '--config',
default='data/config.json',
help='Path to config file')
parser.add_argument('--data',
default='data/',
help='Path to data directory')
parser.add_argument('-v', '--version',
action='version', version=__version__)
args = parser.parse_args()
modum = Modum(args, __file__).run
if args.daemon:
daemon = Daemonize(app='Modum IRC Bot', pid=pid,
action=modum)
daemon.start()
else:
modum()