1 |
unnilennium |
1.1 |
diff -Nur smeserver-bridge-interface-0.1/createlinks smeserver-bridge-interface-0.1_mod/createlinks |
2 |
|
|
--- smeserver-bridge-interface-0.1/createlinks 2008-12-02 03:57:31.000000000 +0100 |
3 |
|
|
+++ smeserver-bridge-interface-0.1_mod/createlinks 2011-04-19 12:21:54.000000000 +0200 |
4 |
|
|
@@ -9,4 +9,7 @@ |
5 |
|
|
service_link_enhanced("bridge", "K01", "0"); |
6 |
|
|
service_link_enhanced("bridge", "K01", "1"); |
7 |
|
|
|
8 |
|
|
- |
9 |
|
|
+foreach my $event (qw/console-save bootstrap-console-save/){ |
10 |
|
|
+ event_link("bridge-disable", "$event", "02"); |
11 |
|
|
+ event_link("bridge-enable", "$event", "98"); |
12 |
|
|
+} |
13 |
|
|
diff -Nur smeserver-bridge-interface-0.1/root/etc/e-smith/events/actions/bridge-disable smeserver-bridge-interface-0.1_mod/root/etc/e-smith/events/actions/bridge-disable |
14 |
|
|
--- smeserver-bridge-interface-0.1/root/etc/e-smith/events/actions/bridge-disable 1970-01-01 01:00:00.000000000 +0100 |
15 |
|
|
+++ smeserver-bridge-interface-0.1_mod/root/etc/e-smith/events/actions/bridge-disable 2011-04-19 12:25:57.000000000 +0200 |
16 |
|
|
@@ -0,0 +1,35 @@ |
17 |
|
|
+#!/usr/bin/perl -w |
18 |
|
|
+#---------------------------------------------------------------------- |
19 |
|
|
+# copyright (C) 2011 Firewall-Services |
20 |
|
|
+# daniel@firewall-services.com |
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 |
|
|
+#---------------------------------------------------------------------- |
37 |
|
|
+ |
38 |
|
|
+use esmith::ConfigDB; |
39 |
|
|
+ |
40 |
|
|
+my $c = esmith::ConfigDB->open() || die "Error opening the ConfigDB\n"; |
41 |
|
|
+my $bridge = $c->get('bridge') || $c->new_record('bridge', {type => 'service'}); |
42 |
|
|
+my $status = $bridge->prop('status') || 'enabled'; |
43 |
|
|
+my $internal = $bridge->prop('ethernetInterface') || 'eth0'; |
44 |
|
|
+ |
45 |
|
|
+if ($status eq 'enabled'){ |
46 |
|
|
+ $c->set_prop('bridge', 'OldStatus', 'enabled'); |
47 |
|
|
+ $c->set_prop('bridge', 'status', 'disabled'); |
48 |
|
|
+ $c->set_prop('InternalInterface', 'Name', "$internal"); |
49 |
|
|
+} |
50 |
|
|
+ |
51 |
|
|
+exit (0); |
52 |
|
|
diff -Nur smeserver-bridge-interface-0.1/root/etc/e-smith/events/actions/bridge-enable smeserver-bridge-interface-0.1_mod/root/etc/e-smith/events/actions/bridge-enable |
53 |
|
|
--- smeserver-bridge-interface-0.1/root/etc/e-smith/events/actions/bridge-enable 1970-01-01 01:00:00.000000000 +0100 |
54 |
|
|
+++ smeserver-bridge-interface-0.1_mod/root/etc/e-smith/events/actions/bridge-enable 2011-04-19 12:28:41.000000000 +0200 |
55 |
|
|
@@ -0,0 +1,38 @@ |
56 |
|
|
+#!/usr/bin/perl -w |
57 |
|
|
+#---------------------------------------------------------------------- |
58 |
|
|
+# copyright (C) 2011 Firewall-Services |
59 |
|
|
+# daniel@firewall-services.com |
60 |
|
|
+# |
61 |
|
|
+# This program is free software; you can redistribute it and/or modify |
62 |
|
|
+# it under the terms of the GNU General Public License as published by |
63 |
|
|
+# the Free Software Foundation; either version 2 of the License, or |
64 |
|
|
+# (at your option) any later version. |
65 |
|
|
+# |
66 |
|
|
+# This program is distributed in the hope that it will be useful, |
67 |
|
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
68 |
|
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
69 |
|
|
+# GNU General Public License for more details. |
70 |
|
|
+# |
71 |
|
|
+# You should have received a copy of the GNU General Public License |
72 |
|
|
+# along with this program; if not, write to the Free Software |
73 |
|
|
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
74 |
|
|
+# |
75 |
|
|
+#---------------------------------------------------------------------- |
76 |
|
|
+ |
77 |
|
|
+use esmith::ConfigDB; |
78 |
|
|
+ |
79 |
|
|
+my $c = esmith::ConfigDB->open() || die "Error opening the ConfigDB\n"; |
80 |
|
|
+my $bridge = $c->get('bridge') || $c->new_record('bridge', {type => 'service'}); |
81 |
|
|
+my $status = $bridge->prop('status') || 'enabled'; |
82 |
|
|
+my $internal = $bridge->prop('bridgeInterface') || 'br0'; |
83 |
|
|
+ |
84 |
|
|
+if ($status eq 'disabled'){ |
85 |
|
|
+ my $oldstatus = $bridge->prop('OldStatus') || 'disabled'; |
86 |
|
|
+ if ($oldstatus eq 'enabled'){ |
87 |
|
|
+ $c->set_prop('bridge', 'status', 'enabled'); |
88 |
|
|
+ $c->set_prop('InternalInterface', 'Name', "$internal"); |
89 |
|
|
+ $c->get_prop_and_delete('bridge','OldStatus'); |
90 |
|
|
+ } |
91 |
|
|
+} |
92 |
|
|
+ |
93 |
|
|
+exit (0); |