Ejemplo n.º 1
0
if args.version:  # prints program legal / dev / version info
    print("Current Version: " + VERSION)
    print("Author: K4YT3X")
    print("License: GNU GPL v3")
    print("Github Page: https://github.com/K4YT3X/SCUTUM")
    print("Contact: [email protected]")
    print()
    exit(0)

log = Logger(LOGPATH)
installer = Installer(CONFPATH)

if args.upgrade:
    installer.check_avalon()
    installer.check_version(VERSION)
    exit(0)

try:
    if os.getuid() != 0:  # Arptables requires root
        avalon.error('SCUTUM must be run as root!')
        print(avalon.FG.LGR + 'It needs to control the system firewall so..' + avalon.FM.RST)
        exit(0)
    if not (args.purgelog or args.install or args.uninstall):
        # if program is doing normal operations, log everything
        # pointless if purging log, installing/removing
        log.writeLog(str(datetime.datetime.now()) + ' ---- START ----')
        log.writeLog(str(datetime.datetime.now()) + '  UID: ' + str(os.getuid()))
        if not os.path.isfile(CONFPATH):  # Configuration not found
            avalon.error('SCUTUM configuration file not found! Please re-install SCUTUM!')
            avalon.warning('Please run "scutum --install" before using it for the first time')