#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import unicode_literals, print_function

import sys
import os
import time

import zoid

if __name__ == '__main__':
    LOG = zoid.LOG

    zoid.ARGPARSER.add_argument("--run", dest="action", action="store_const", const="run", help="run the daemon")
    zoid.ARGPARSER.add_argument("--kill", dest="action", action="store_const", const="kill", help="kill the daemon")

    zoid.init()

    if zoid.ARGS.action == "run":
        LOG.info("starting daemon process")
        zoid.Daemon.main()
    else:
        LOG.info("killing daemon process")
        zoid.Daemon.kill()
