• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <string.h>
2 #include <stdio.h>
3 #include <gpxe/command.h>
4 #include <gpxe/login_ui.h>
5 
6 FILE_LICENCE ( GPL2_OR_LATER );
7 
login_exec(int argc,char ** argv)8 static int login_exec ( int argc, char **argv ) {
9 	int rc;
10 
11 	if ( argc > 1 ) {
12 		printf ( "Usage: %s\n"
13 			 "Prompt for login credentials\n", argv[0] );
14 		return 1;
15 	}
16 
17 	if ( ( rc = login_ui() ) != 0 ) {
18 		printf ( "Could not set credentials: %s\n",
19 			 strerror ( rc ) );
20 		return 1;
21 	}
22 
23 	return 0;
24 }
25 
26 struct command login_command __command = {
27 	.name = "login",
28 	.exec = login_exec,
29 };
30