summaryrefslogtreecommitdiffstats
path: root/src/hci/commands/login_cmd.c
blob: e425247da3c956f2be554cc548162df5b1a1d373 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <string.h>
#include <stdio.h>
#include <gpxe/command.h>
#include <gpxe/login_ui.h>

static int login_exec ( int argc, char **argv ) {
	int rc;

	if ( argc > 1 ) {
		printf ( "Usage: %s\n"
			 "Prompt for login credentials\n", argv[0] );
		return 1;
	}

	if ( ( rc = login_ui() ) != 0 ) {
		printf ( "Could not set credentials: %s\n",
			 strerror ( rc ) );
		return 1;
	}

	return 0;
}

struct command login_command __command = {
	.name = "login",
	.exec = login_exec,
};