login_cmd.c
Go to the documentation of this file.00001 #include <string.h>
00002 #include <stdio.h>
00003 #include <gpxe/command.h>
00004 #include <gpxe/login_ui.h>
00005
00006 FILE_LICENCE ( GPL2_OR_LATER );
00007
00008 static int login_exec ( int argc, char **argv ) {
00009 int rc;
00010
00011 if ( argc > 1 ) {
00012 printf ( "Usage: %s\n"
00013 "Prompt for login credentials\n", argv[0] );
00014 return 1;
00015 }
00016
00017 if ( ( rc = login_ui() ) != 0 ) {
00018 printf ( "Could not set credentials: %s\n",
00019 strerror ( rc ) );
00020 return 1;
00021 }
00022
00023 return 0;
00024 }
00025
00026 struct command login_command __command = {
00027 .name = "login",
00028 .exec = login_exec,
00029 };