meshlink_stop(mesh);
if(!meshlink_join(mesh, arg))
fprintf(stderr, "Could not join using invitation: %s\n", meshlink_strerror(meshlink_errno));
- else {
+ else
fprintf(stderr, "Invitation accepted!\n");
- if(!meshlink_start(mesh)) {
- fprintf(stderr, "Could not start MeshLink: %s\n", meshlink_strerror(meshlink_errno));
- return;
- }
+ if(!meshlink_start(mesh)) {
+ fprintf(stderr, "Could not restart MeshLink: %s\n", meshlink_strerror(meshlink_errno));
+ exit(1);
}
} else if(!strcasecmp(buf, "kick")) {
if(!arg) {
return;
}
+ mesh->stop();
+
if(!mesh->join(arg))
fprintf(stderr, "Could not join using invitation: %s\n", meshlink::strerror());
else
fprintf(stderr, "Invitation accepted!\n");
+
+ if(!mesh->start()) {
+ fprintf(stderr, "Could not restart MeshLink: %s\n", meshlink::strerror());
+ exit(1);
+ }
} else if(!strcasecmp(buf, "kick")) {
if(!arg) {
fprintf(stderr, "/kick requires an argument!\n");
fprintf(stderr, "Could not join using invitation: %s\n", meshlink_strerror(meshlink_errno));
else {
fprintf(stderr, "Invitation accepted!\n");
- meshlink_start(mesh[nodeindex]);
+ }
+ if(!meshlink_start(mesh[nodeindex])) {
+ fprintf(stderr, "Could not restart MeshLink: %s\n", meshlink_strerror(meshlink_errno));
+ exit(1);
}
} else if(!strcasecmp(buf, "kick")) {
if(!arg) {