5 void shell_sys(char ** argv, int elem) {
8 printf(" sys [show|name|password|restart] \n");
12 if (strncmp(argv[1], "show", 4) == 0) {
13 printf("Name: \t\t%s\n", settings.name);
14 printf("Model: \t\t%s\n", settings.model);
15 printf("SW-Version:\t %s\n", settings.swVersion);
16 }else if (strncmp(argv[1], "name", 4) == 0) {
18 printf("Please provide a name\n");
23 printError(gs105e_setName(argv[2]));
25 }else if (strncmp(argv[1], "password", 4) == 0) {
29 char * newPwd = copyString(getpass("New Password: "));
30 if (strlen(newPwd) == 0) {
31 printf("Password musst be at least one character!\n");
34 char * newPwdConf = copyString(getpass("New Password: "));
35 printf("%p %p\n", settings.password, newPwd);
36 if (strncmp(newPwd, newPwdConf, strlen(newPwd)) == 0 && strlen(newPwd) == strlen(newPwdConf)) {
37 int e = gs105e_setPassword(newPwd);
41 settings.password = newPwd;
43 printf("Passwords do not match!\n");
45 }else if (strncmp(argv[1], "restart", 4) == 0) {
47 printError(gs105e_restart());