summaryrefslogtreecommitdiff
path: root/gpxe/src/hci/commands/login_cmd.c
blob: 0da2497a730dd0b199e96e9a93977e9305d85db2 (plain)
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
28
29
#include <string.h>
#include <stdio.h>
#include <gpxe/command.h>
#include <gpxe/login_ui.h>

FILE_LICENCE ( GPL2_OR_LATER );

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,
};