You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

login_cmd.c 514B

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