public static void main(String[] args) {
        if (args.length < 4) {
            invalidArguments();
        }
        String mode = args[0];
        if (!(mode.equalsIgnoreCase("d") || mode.equalsIgnoreCase("g"))) {
            invalidArguments();
        }
        String command = args[2];
        if (command.equalsIgnoreCase("init")) {
            String initParam = args[3];
            if (initParam.matches("\\d+")) {
                loadEndpoints(mode, args[1]);
                init(getEndpointByID(Integer.parseInt(initParam)));
            }
        } else {
            if (command.equalsIgnoreCase("shutdown")) {
                String shutdownParam = args[3];
                if (shutdownParam.toLowerCase().equals("all")) {
                    //shutdown all endpoints
                    loadEndpoints(mode, args[1]);
                    shutdownAll();
                } else {
                    if (shutdownParam.matches("\\d+")) {
                        //shutdown single endpoint
                        loadEndpoints(mode, args[1]);
                        shutdown(Integer.parseInt(shutdownParam));
                    }
                }
            } else {
                invalidArguments();
            }
        }
    }