[17951] | 1 | #ifndef INFO_H
|
---|
| 2 | #define INFO_H
|
---|
| 3 |
|
---|
| 4 | void screengetserial()
|
---|
| 5 | {
|
---|
| 6 | char* cpu = NULL;
|
---|
| 7 | char* tmpstr = NULL;
|
---|
| 8 |
|
---|
| 9 | cpu = getcpuid();
|
---|
| 10 | if(cpu == NULL) return;
|
---|
| 11 |
|
---|
| 12 | tmpstr = ostrcat("Board-ID SerialNr: ", cpu, 0, 0);
|
---|
| 13 | writesys("/tmp/atemio.log", tmpstr, 1);
|
---|
| 14 |
|
---|
| 15 | char* cmd = NULL;
|
---|
| 16 | cmd = ostrcat(cmd, "/var/backup/atemio.", 1, 0);
|
---|
| 17 | cmd = ostrcat(cmd, cpu, 1, 0);
|
---|
| 18 | cmd = ostrcat(cmd, ".log", 1, 0);
|
---|
| 19 | writesys(cmd, tmpstr, 1);
|
---|
| 20 | free(tmpstr); tmpstr = NULL;
|
---|
| 21 | free(cmd); cmd = NULL;
|
---|
| 22 |
|
---|
| 23 | tmpstr = ostrcat(_("For next OnlineUpdate please contact Atemio and send this Serial Number\nand your Atemio Serial Number !!\n\nBoard-ID SerialNr:"), " ", 0, 0);
|
---|
| 24 | tmpstr = ostrcat(tmpstr, cpu, 1, 0);
|
---|
| 25 | tmpstr = ostrcat(tmpstr, "\n\n", 1, 0);
|
---|
| 26 | tmpstr = ostrcat(tmpstr, _("Email info@atemio.de"), 1, 0);
|
---|
| 27 | textbox(_("Info"), _(tmpstr), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1100, 400, 0, 1);
|
---|
| 28 |
|
---|
| 29 | free(cpu); cpu = NULL;
|
---|
| 30 | free(tmpstr); tmpstr = NULL;
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | void screensystem_info(int mode)
|
---|
| 34 | {
|
---|
| 35 | char* tmpstr = NULL;
|
---|
| 36 | int rcret = 0;
|
---|
| 37 | struct skin* systeminfo = getscreen("systeminfo");
|
---|
| 38 | struct skin* info = getscreennode(systeminfo, "info");
|
---|
| 39 | struct skin* load = getscreen("loading");
|
---|
| 40 | drawscreen(load, 0, 0);
|
---|
| 41 |
|
---|
| 42 | addscreenrc(systeminfo, info);
|
---|
| 43 |
|
---|
| 44 | if(mode == 0)
|
---|
| 45 | {
|
---|
| 46 | char* tmpstr1 = NULL, *tmpstr2 = NULL, *tmpstr3 = NULL;
|
---|
| 47 |
|
---|
| 48 | changetitle(systeminfo, _("Infos"));
|
---|
| 49 |
|
---|
| 50 | tmpstr1 = readfiletomem("/etc/motd", 0);
|
---|
| 51 | if(tmpstr1 != NULL) tmpstr2 = strstr(tmpstr1, "wElc0me");
|
---|
| 52 | tmpstr3 = readfiletomem("/etc/imageinfo", 0);
|
---|
| 53 | if(tmpstr2 == NULL)
|
---|
| 54 | tmpstr = ostrcat(tmpstr3, NULL, 1, 0);
|
---|
| 55 | else
|
---|
| 56 | tmpstr = ostrcat(tmpstr2, tmpstr3, 0, 1);
|
---|
| 57 | changetext(info, tmpstr);
|
---|
| 58 |
|
---|
| 59 | free(tmpstr1); tmpstr1 = NULL;
|
---|
| 60 | free(tmpstr); tmpstr = NULL;
|
---|
| 61 | }
|
---|
| 62 | else if(mode == 1)
|
---|
| 63 | {
|
---|
[18617] | 64 | changetitle(systeminfo, _("Infos"));
|
---|
| 65 |
|
---|
[18234] | 66 | if(isfile("/etc/model") == 0) return;
|
---|
[17951] | 67 | char* boxversion = string_tolower(readsys("/etc/model", 1));
|
---|
| 68 | char* path = NULL;
|
---|
[17965] | 69 | char* out = NULL;
|
---|
[23215] | 70 |
|
---|
[24030] | 71 | // if(file_exist("/etc/.beta"))
|
---|
[23215] | 72 | path = ostrcat(path, "/svn/image-beta/changelog.", 1, 0);
|
---|
[24030] | 73 | // else
|
---|
| 74 | // path = ostrcat(path, "/svn/image/changelog.", 1, 0);
|
---|
[23215] | 75 |
|
---|
[17951] | 76 | path = ostrcat(path, boxversion, 1, 0);
|
---|
| 77 | path = ostrcat(path, ".titan", 1, 0);
|
---|
[23215] | 78 |
|
---|
[24030] | 79 | // if(file_exist("/etc/.beta"))
|
---|
[23215] | 80 | tmpstr = gethttp("titannit.dyndns.tv", path, 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
[24030] | 81 | // else
|
---|
| 82 | // tmpstr = gethttp("atemio.dyndns.tv", path, 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
[23215] | 83 |
|
---|
[17951] | 84 | free(path), path = NULL;
|
---|
| 85 | free(boxversion), boxversion = NULL;
|
---|
[17965] | 86 | out = readfromlinetoline(tmpstr, 37, 537, 1);
|
---|
| 87 | changetext(info, out);
|
---|
[17951] | 88 | }
|
---|
| 89 | else if(mode == 2)
|
---|
[18617] | 90 | {
|
---|
| 91 | changetitle(systeminfo, _("Infos"));
|
---|
| 92 |
|
---|
[17951] | 93 | char* path = NULL;
|
---|
[17965] | 94 | char* out = NULL;
|
---|
[23215] | 95 |
|
---|
[24030] | 96 | // if(file_exist("/etc/.beta"))
|
---|
[23215] | 97 | path = ostrcat(path, "/svn/image-beta/changelog.git", 1, 0);
|
---|
[24030] | 98 | // else
|
---|
| 99 | // path = ostrcat(path, "/svn/image/changelog.git", 1, 0);
|
---|
[23215] | 100 |
|
---|
[24030] | 101 | // if(file_exist("/etc/.beta"))
|
---|
[23215] | 102 | tmpstr = gethttp("titannit.dyndns.tv", path, 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
[24030] | 103 | // else
|
---|
| 104 | // tmpstr = gethttp("atemio.dyndns.tv", path, 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
[23215] | 105 |
|
---|
[17951] | 106 | free(path), path = NULL;
|
---|
[17965] | 107 | out = readfromlinetoline(tmpstr, 0, 500, 1);
|
---|
| 108 | changetext(info, out);
|
---|
[17951] | 109 | }
|
---|
| 110 |
|
---|
| 111 | clearscreen(load);
|
---|
| 112 | drawscreen(systeminfo, 0, 0);
|
---|
| 113 |
|
---|
| 114 | while(1)
|
---|
| 115 | {
|
---|
| 116 | rcret = waitrc(systeminfo, 0, 0);
|
---|
| 117 |
|
---|
| 118 | if(rcret == getrcconfigint("rcexit", NULL)) break;
|
---|
| 119 | if(rcret == getrcconfigint("rcok", NULL)) break;
|
---|
| 120 | }
|
---|
| 121 |
|
---|
| 122 | delownerrc(systeminfo);
|
---|
| 123 | clearscreen(systeminfo);
|
---|
| 124 | }
|
---|
| 125 |
|
---|
| 126 | #endif
|
---|