#!/usr/bin/env python
# -*- coding: utf-8 -*-
# +--------------------------------------------------------------------------+
# | OpenFW UTM Community                                                     |
# +--------------------------------------------------------------------------+

from optparse import OptionParser

from endian.job.engine_control import send_cmd_to_engine


def main():
    usage = "usage: %prog <options>"
    parser = OptionParser(usage)    

    parser.add_option("-d", "--debug", dest="debug", action="store_true",
                      help="Be more verbose.", default=False)
    parser.add_option("-u", "--no_unset", dest="no_unset", action="store_true",
                      help="Do not unset symlinks.", default=False)
    parser.add_option("-s", "--no_set", dest="no_set", action="store_true",
                      help="Do not set symlinks.", default=False)
    parser.add_option("-v", "--no_pre_unset", dest="no_pre_unset", action="store_true",
                      help="Do not trigger pre_unset hook.", default=False)
    parser.add_option("-w", "--no_post_unset", dest="no_post_unset", action="store_true",
                      help="Do not trigger post_unset hook.", default=False)
    parser.add_option("-r", "--no_pre_set", dest="no_pre_set", action="store_true",
                      help="Do not trigger pre_set hook.", default=False)
    parser.add_option("-t", "--no_post_set", dest="no_post_set", action="store_true",
                      help="Do not trigger post_set hook.", default=False)

    (options, args) = parser.parse_args()
    
    send_cmd_to_engine("restart urlfiltercron", options=options)


if __name__ == "__main__":
    main()
