def main():
    params = get_params()
    if (((_platform == 'linux') or (_platform == 'linux2')) and (os.geteuid() != 0)):
        logger.error('Script must be run as root')
        return 1
    shell = MagicBlueShell(params.bluetooth_adapter, params.bulb_version)
    if params.list_commands:
        shell.list_commands()
    elif params.command:
        logging.basicConfig(level=logging.WARNING)
        if params.mac_address:
            shell.cmd_connect([params.mac_address])
        shell.exec_cmd(params.command)
    else:
        logging.basicConfig(level=logging.INFO)
        shell.start_interactive_mode()
    return 0
def main():
    params = get_params()
    if (((_platform == 'linux') or (_platform == 'linux2')) and (os.geteuid() != 0)):
        logger.error('Script must be run as root')
        return 1
    shell = MagicBlueShell(params.bluetooth_adapter, params.bulb_version)
    if params.list_commands:
        shell.list_commands()
    elif params.command:
        logging.basicConfig(level=logging.WARNING)
        if params.mac_address:
            shell.cmd_connect([params.mac_address])
        shell.exec_cmd(params.command)
    else:
        logging.basicConfig(level=logging.INFO)
        shell.start_interactive_mode()
    return 0