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 | {
|
---|
64 | changetitle(systeminfo, _("Infos"));
|
---|
65 |
|
---|
66 | if(isfile("/etc/model") == 0) return;
|
---|
67 | char* boxversion = string_tolower(readsys("/etc/model", 1));
|
---|
68 | char* path = NULL;
|
---|
69 | char* out = NULL;
|
---|
70 |
|
---|
71 | // if(file_exist("/etc/.beta"))
|
---|
72 | path = ostrcat(path, "/svn/image-beta/changelog.", 1, 0);
|
---|
73 | // else
|
---|
74 | // path = ostrcat(path, "/svn/image/changelog.", 1, 0);
|
---|
75 |
|
---|
76 | path = ostrcat(path, boxversion, 1, 0);
|
---|
77 | path = ostrcat(path, ".titan", 1, 0);
|
---|
78 |
|
---|
79 | // if(file_exist("/etc/.beta"))
|
---|
80 | tmpstr = gethttp("titannit.dyndns.tv", path, 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
81 | // else
|
---|
82 | // tmpstr = gethttp("atemio.dyndns.tv", path, 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
83 |
|
---|
84 | free(path), path = NULL;
|
---|
85 | free(boxversion), boxversion = NULL;
|
---|
86 | out = readfromlinetoline(tmpstr, 37, 537, 1);
|
---|
87 | changetext(info, out);
|
---|
88 | }
|
---|
89 | else if(mode == 2)
|
---|
90 | {
|
---|
91 | changetitle(systeminfo, _("Infos"));
|
---|
92 |
|
---|
93 | char* path = NULL;
|
---|
94 | char* out = NULL;
|
---|
95 |
|
---|
96 | // if(file_exist("/etc/.beta"))
|
---|
97 | path = ostrcat(path, "/svn/image-beta/changelog.git", 1, 0);
|
---|
98 | // else
|
---|
99 | // path = ostrcat(path, "/svn/image/changelog.git", 1, 0);
|
---|
100 |
|
---|
101 | // if(file_exist("/etc/.beta"))
|
---|
102 | tmpstr = gethttp("titannit.dyndns.tv", path, 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
103 | // else
|
---|
104 | // tmpstr = gethttp("atemio.dyndns.tv", path, 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
105 |
|
---|
106 | free(path), path = NULL;
|
---|
107 | out = readfromlinetoline(tmpstr, 0, 500, 1);
|
---|
108 | changetext(info, out);
|
---|
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
|
---|