diff --git a/src/client/distren.c b/src/client/distren.c --- a/src/client/distren.c +++ b/src/client/distren.c @@ -40,9 +40,9 @@ int main(int argc, char *argv[]) { struct options_common *options; - + cfg_t *cfg; - + cfg_opt_t cfg_opts[] = { CFG_STR_LIST("render_types", NULL, 0), @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) int i; i = 1; - + if(options_init(argc, argv, &cfg, cfg_opts, "client", &options)) { fprintf(stderr, "error getting configuration\n"); @@ -71,16 +71,14 @@ int main(int argc, char *argv[]) //strcat(username, hostname); - if( i == 1 ){ - // Create new account on the server if no username exists - // THIS no longer SEGFAULTS!! YAY + // SSH's to client machine with the username speficied. char buf[10]; struct execio *testrem; char *execargv[] = { "ssh", "username", //cfg_getstr(cfg, "username") . "@" . cfg_getstr(cfg, "hostname"), - "-i guest.rsa", //yeaaaah enay better ideas? + "-i guest.rsa", //yeaaaah any better ideas? "sh", "-c", "\"echo hello from ${HOSTNAME}\"", // "\"useradd -M -c" strcat( cfg_getstr(cfg, "name") cfg_getstr(cfg, "email")) "-d /home/distren --gid 537" cfg_getstr(cfg, "username") "\"", @@ -103,13 +101,9 @@ int main(int argc, char *argv[]) } execio_close(testrem); } - - else - { - printf("Well now, you must have registered!\n"); - /* put code here to ssh to zserver2 w/ execio as the user from the conf file */ - } - + // Can we prune off some of this code up here^? I'm not exactly sure how execio returns output, but it seems like more could be happening in execio itself, and less happening where it is actually called. + // We need some code to ssh, and if the SSH fails, tell the user to register. + // Killed the user reg code, as the php interface will take care of this. Although it should check for users... options_free(options); return 0;