Esempio n. 1
0
int main (int argc, char *argv[]) {
	const char *options = "srl:u:v:k:a:c:hH";
	int opt;
	int service_load = 0;
	unsigned int nodeid;
	int service_unload = 0;
	char *service = NULL;
	unsigned int version = 0;

	if (argc == 1) {
		usage_do ();
	}
	while ( (opt = getopt(argc, argv, options)) != -1 ) {
		switch (opt) {
		case 's':
			ringstatusget_do ();
			break;
		case 'r':
			ringreenable_do ();
			break;
		case 'l':
			service_load = 1;
			service = xstrdup (optarg);
			break;
		case 'u':
			service_unload = 1;
			service = xstrdup (optarg);
			break;
		case 'k':
			nodeid = atoi (optarg);
			killnode_do(nodeid);
			break;
		case 'H':
			shutdown_do();
			break;
		case 'a':
			showaddrs_do( atoi(optarg) );
			break;
		case 'c':
			crypto_do( atoi(optarg) );
			break;
		case 'v':
			version = atoi (optarg);
			break;
		case 'h':
			usage_do();
			break;
		}
	}

	if (service_load) {
		service_load_do (service, version);
	} else
	if (service_unload) {
		service_unload_do (service, version);
	}

	return (0);
}
Esempio n. 2
0
int main (int argc, char *argv[]) {
	const char *options = "i:srRk:a:hH";
	int opt;
	unsigned int nodeid;
	char interface_name[128] = "";
	int rc=0;

	if (argc == 1) {
		usage_do ();
	}
	while ( (opt = getopt(argc, argv, options)) != -1 ) {
		switch (opt) {
		case 'i':
			strncpy(interface_name, optarg, sizeof(interface_name));
			break;
		case 's':
			printf("xxx 47000: tools/corosync-cfgtool.c main case \'s\' interface name (%s)", interface_name);
			rc = ringstatusget_do (interface_name);
			printf("xxx 47001: tools/corosync-cfgtool.c main case \'s\' interface name (%s)", interface_name);
			break;
		case 'R':
			rc = reload_config_do ();
			break;
		case 'r':
			ringreenable_do ();
			break;
		case 'k':
			nodeid = atoi (optarg);
			killnode_do(nodeid);
			break;
		case 'H':
			shutdown_do();
			break;
		case 'a':
			showaddrs_do( atoi(optarg) );
			break;
		case 'h':
			usage_do();
			break;
		}
	}

	return (rc);
}
int main (int argc, char *argv[]) {
	const char *options = "sr";
	int opt;

	if (argc == 1) {
		usage_do ();
	}
	while ( (opt = getopt(argc, argv, options)) != -1 ) {
		switch (opt) {
		case 's':
			ringstatusget_do ();
			break;
		case 'r':
			ringreenable_do ();
			break;
		}
	}

	return (0);
}