Changeset - 71b7b74b07a9
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-07-25 01:26:53

Commenting
1 file changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -56,39 +56,43 @@ int main(int argc, char *argv[])
 
		if(!strchr(email, '@'))
 
		{
 
			fprintf(stderr, "I want to see an '@' in your email address!\n%s may be good enough for you, but I need more!\n", email);
 
			return 235;
 
		}
 
		*key = register_user(username, email); // register_user returns a uniquely random url to a key
 
		get("http://protofusion.org/distren/key/%s",key);
 
		fprintf(stderr, "You registered, hopefully successfully. Invoke distrenslave with no args now.");
 
		exec('echo %s >> distrenslave.conf',key);
 
	}
 
/* End arg parser */
 

	
 

	
 

	
 
/* Option getter: Creates vars to grab stuff from conf, uses the options include to grab this data */
 
char *username;
 
char *key;
 

	
 
username = NULL;
 
key = NULL;
 

	
 
cfg_t * my_cfg;
 
cfg_opt_t myopts = {
 
		CFG_SIMPLE_STR("username"), &username),
 
		CFG_SIMPLE_STR("key"), &key),
 
		CFG_END()
 
		};
 
struct options_common *commonopts
 
options_init(argc,argv,&my_cfg, &myopts, "slave", &commonopts);
 
/* End option getter */
 

	
 

	
 
/* If there's no key or username in the conf, let them know! */
 
	if(key == NULL || username == NULL){
 
		fprintf(stderr,"You didn't register! \n Please register (Invoke 'distrenslave -c <username> <emailaddr> to register) \nor add your username to distrenslave.conf");
 
	}
 
	else if(key != NULL || username != NULL){
 
		loginuser(username); // Logs in user to the server
 
	}
 
	else{
 
		fprintf(stderr,"Something is terribly wrong!!!");
 
	}
 

	
 

	
 
	if('slave recieves "start frame#, job#"'){
0 comments (0 inline, 0 general)