1 |
diff -Nur e-smith-base-5.8.0/console_wrapper.c e-smith-base-5.8.0_bz9393/console_wrapper.c |
2 |
--- e-smith-base-5.8.0/console_wrapper.c 1970-01-01 01:00:00.000000000 +0100 |
3 |
+++ e-smith-base-5.8.0_bz9393/console_wrapper.c 2016-05-12 18:59:28.381581784 +0200 |
4 |
@@ -0,0 +1,8 @@ |
5 |
+#include <unistd.h> |
6 |
+#define CONSOLE_PATH "/sbin/e-smith/console.pl" |
7 |
+int main(ac, av) |
8 |
+char **av; |
9 |
+{ |
10 |
+ execv(CONSOLE_PATH, av); |
11 |
+ return 0; |
12 |
+} |
13 |
diff -Nur e-smith-base-5.8.0/root/sbin/e-smith/console e-smith-base-5.8.0_bz9393/root/sbin/e-smith/console |
14 |
--- e-smith-base-5.8.0/root/sbin/e-smith/console 2016-02-05 00:14:13.000000000 +0100 |
15 |
+++ e-smith-base-5.8.0_bz9393/root/sbin/e-smith/console 1970-01-01 01:00:00.000000000 +0100 |
16 |
@@ -1,107 +0,0 @@ |
17 |
-#!/usr/bin/perl -wT |
18 |
- |
19 |
-#---------------------------------------------------------------------- |
20 |
-# copyright (C) 1999-2006 Mitel Corporation |
21 |
-# |
22 |
-# This program is free software; you can redistribute it and/or modify |
23 |
-# it under the terms of the GNU General Public License as published by |
24 |
-# the Free Software Foundation; either version 2 of the License, or |
25 |
-# (at your option) any later version. |
26 |
-# |
27 |
-# This program is distributed in the hope that it will be useful, |
28 |
-# but WITHOUT ANY WARRANTY; without even the implied warranty of |
29 |
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
30 |
-# GNU General Public License for more details. |
31 |
-# |
32 |
-# You should have received a copy of the GNU General Public License |
33 |
-# along with this program; if not, write to the Free Software |
34 |
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
35 |
-#---------------------------------------------------------------------- |
36 |
-package esmith::console; |
37 |
- |
38 |
-use strict; |
39 |
- |
40 |
-use Locale::gettext; |
41 |
-use esmith::ConfigDB::unsaved; |
42 |
-use esmith::console; |
43 |
-use esmith::console::quitConsole; |
44 |
- |
45 |
-my $console = esmith::console->new(); |
46 |
- |
47 |
-my $db = esmith::ConfigDB::unsaved->open; |
48 |
- |
49 |
-my $termType = $db->get_prop('serial-console', 'Terminal') || ''; |
50 |
-my $SystemName = $db->get_value('SystemName'); |
51 |
-my $DomainName = $db->get_value('DomainName'); |
52 |
- |
53 |
-$ENV{TERM} = $termType if($termType); |
54 |
- |
55 |
-system '/bin/sh', '/etc/profile.d/lang.sh'; |
56 |
- |
57 |
-my %menu2object = (); |
58 |
-my @args = (); |
59 |
-my @items = (); |
60 |
- |
61 |
-my $menu_dir = '/sbin/e-smith/console-menu-items'; |
62 |
- |
63 |
-opendir ITEMS, $menu_dir; |
64 |
- |
65 |
-while (defined (my $item = readdir ITEMS )) |
66 |
-{ |
67 |
- next unless -f "$menu_dir/$item"; |
68 |
- |
69 |
- if ($item =~ /([\w\.]+)/) |
70 |
- { |
71 |
- $item = $1; |
72 |
- } |
73 |
- else |
74 |
- { |
75 |
- warn "Don't know what to do with $menu_dir/$item\n"; |
76 |
- next; |
77 |
- } |
78 |
- |
79 |
- my $obj = require "$menu_dir/$item"; |
80 |
- |
81 |
- push @items, $obj; |
82 |
-} |
83 |
- |
84 |
-close ITEMS; |
85 |
- |
86 |
-my $number = 1; |
87 |
- |
88 |
-foreach my $item (sort { $a->order <=> $b->order } @items) |
89 |
-{ |
90 |
- next if ($item->order < 0); |
91 |
- push @args, $number . '.', gettext($item->name); |
92 |
- $menu2object{$number++ . '.'} = $item; |
93 |
-} |
94 |
- |
95 |
-my $quit = esmith::console::quitConsole->new; |
96 |
-while (1) |
97 |
-{ |
98 |
- #---------------------------------------- |
99 |
- # Reload the configuration from file |
100 |
- #---------------------------------------- |
101 |
- |
102 |
- $db->reload; |
103 |
- |
104 |
- my $title = gettext('Server console'); |
105 |
- $title .= " (${SystemName}.${DomainName}) "; |
106 |
- |
107 |
- $title .= gettext('** unsaved changes **') |
108 |
- if ( $db->get_value('UnsavedChanges') eq 'yes' ); |
109 |
- |
110 |
- my ($rc, $choice) = $console->menu_page |
111 |
- ( |
112 |
- title => $title, |
113 |
- text => |
114 |
- gettext('Welcome to the server console!') . |
115 |
- "\n\n" . |
116 |
- gettext('Use the Arrow and Tab keys to make your selection, then press Enter.'), |
117 |
- argsref => \@args, |
118 |
- left => gettext('Exit'), |
119 |
- ); |
120 |
- |
121 |
- $choice = ($rc == 0) ? $menu2object{$choice} : $quit; |
122 |
- $choice->doit($console, $db); |
123 |
-} |
124 |
diff -Nur e-smith-base-5.8.0/root/sbin/e-smith/console.pl e-smith-base-5.8.0_bz9393/root/sbin/e-smith/console.pl |
125 |
--- e-smith-base-5.8.0/root/sbin/e-smith/console.pl 1970-01-01 01:00:00.000000000 +0100 |
126 |
+++ e-smith-base-5.8.0_bz9393/root/sbin/e-smith/console.pl 2016-02-05 00:14:13.000000000 +0100 |
127 |
@@ -0,0 +1,107 @@ |
128 |
+#!/usr/bin/perl -wT |
129 |
+ |
130 |
+#---------------------------------------------------------------------- |
131 |
+# copyright (C) 1999-2006 Mitel Corporation |
132 |
+# |
133 |
+# This program is free software; you can redistribute it and/or modify |
134 |
+# it under the terms of the GNU General Public License as published by |
135 |
+# the Free Software Foundation; either version 2 of the License, or |
136 |
+# (at your option) any later version. |
137 |
+# |
138 |
+# This program is distributed in the hope that it will be useful, |
139 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
140 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
141 |
+# GNU General Public License for more details. |
142 |
+# |
143 |
+# You should have received a copy of the GNU General Public License |
144 |
+# along with this program; if not, write to the Free Software |
145 |
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
146 |
+#---------------------------------------------------------------------- |
147 |
+package esmith::console; |
148 |
+ |
149 |
+use strict; |
150 |
+ |
151 |
+use Locale::gettext; |
152 |
+use esmith::ConfigDB::unsaved; |
153 |
+use esmith::console; |
154 |
+use esmith::console::quitConsole; |
155 |
+ |
156 |
+my $console = esmith::console->new(); |
157 |
+ |
158 |
+my $db = esmith::ConfigDB::unsaved->open; |
159 |
+ |
160 |
+my $termType = $db->get_prop('serial-console', 'Terminal') || ''; |
161 |
+my $SystemName = $db->get_value('SystemName'); |
162 |
+my $DomainName = $db->get_value('DomainName'); |
163 |
+ |
164 |
+$ENV{TERM} = $termType if($termType); |
165 |
+ |
166 |
+system '/bin/sh', '/etc/profile.d/lang.sh'; |
167 |
+ |
168 |
+my %menu2object = (); |
169 |
+my @args = (); |
170 |
+my @items = (); |
171 |
+ |
172 |
+my $menu_dir = '/sbin/e-smith/console-menu-items'; |
173 |
+ |
174 |
+opendir ITEMS, $menu_dir; |
175 |
+ |
176 |
+while (defined (my $item = readdir ITEMS )) |
177 |
+{ |
178 |
+ next unless -f "$menu_dir/$item"; |
179 |
+ |
180 |
+ if ($item =~ /([\w\.]+)/) |
181 |
+ { |
182 |
+ $item = $1; |
183 |
+ } |
184 |
+ else |
185 |
+ { |
186 |
+ warn "Don't know what to do with $menu_dir/$item\n"; |
187 |
+ next; |
188 |
+ } |
189 |
+ |
190 |
+ my $obj = require "$menu_dir/$item"; |
191 |
+ |
192 |
+ push @items, $obj; |
193 |
+} |
194 |
+ |
195 |
+close ITEMS; |
196 |
+ |
197 |
+my $number = 1; |
198 |
+ |
199 |
+foreach my $item (sort { $a->order <=> $b->order } @items) |
200 |
+{ |
201 |
+ next if ($item->order < 0); |
202 |
+ push @args, $number . '.', gettext($item->name); |
203 |
+ $menu2object{$number++ . '.'} = $item; |
204 |
+} |
205 |
+ |
206 |
+my $quit = esmith::console::quitConsole->new; |
207 |
+while (1) |
208 |
+{ |
209 |
+ #---------------------------------------- |
210 |
+ # Reload the configuration from file |
211 |
+ #---------------------------------------- |
212 |
+ |
213 |
+ $db->reload; |
214 |
+ |
215 |
+ my $title = gettext('Server console'); |
216 |
+ $title .= " (${SystemName}.${DomainName}) "; |
217 |
+ |
218 |
+ $title .= gettext('** unsaved changes **') |
219 |
+ if ( $db->get_value('UnsavedChanges') eq 'yes' ); |
220 |
+ |
221 |
+ my ($rc, $choice) = $console->menu_page |
222 |
+ ( |
223 |
+ title => $title, |
224 |
+ text => |
225 |
+ gettext('Welcome to the server console!') . |
226 |
+ "\n\n" . |
227 |
+ gettext('Use the Arrow and Tab keys to make your selection, then press Enter.'), |
228 |
+ argsref => \@args, |
229 |
+ left => gettext('Exit'), |
230 |
+ ); |
231 |
+ |
232 |
+ $choice = ($rc == 0) ? $menu2object{$choice} : $quit; |
233 |
+ $choice->doit($console, $db); |
234 |
+} |