1 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/db/configuration/migrate/nutPass mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/db/configuration/migrate/nutPass |
2 |
--- e-smith-nutUPS-1.2.0/root/etc/e-smith/db/configuration/migrate/nutPass 1969-12-31 17:00:00.000000000 -0700 |
3 |
+++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/db/configuration/migrate/nutPass 2006-12-21 12:55:28.000000000 -0700 |
4 |
@@ -0,0 +1,52 @@ |
5 |
+{ |
6 |
+ use MIME::Base64 qw(encode_base64); |
7 |
+ |
8 |
+ my $nutrec = $DB->get('nut') || $DB->new_record('nut', {type => 'service'}); |
9 |
+ my $master_pw = $nutrec->prop('MasterPass'); |
10 |
+ if (not $master_pw) |
11 |
+ { |
12 |
+ $master_pw = "not set due to error"; |
13 |
+ if ( open( RANDOM, "/dev/urandom" ) ) |
14 |
+ { |
15 |
+ my $buf; |
16 |
+ if ( read( RANDOM, $buf, 57 ) != 57 ) |
17 |
+ { |
18 |
+ warn("Short read from /dev/random: $!"); |
19 |
+ } |
20 |
+ else |
21 |
+ { |
22 |
+ $master_pw = encode_base64($buf); |
23 |
+ chomp $master_pw; |
24 |
+ } |
25 |
+ close RANDOM; |
26 |
+ } |
27 |
+ else |
28 |
+ { |
29 |
+ warn "Could not open /dev/urandom: $!"; |
30 |
+ } |
31 |
+ $nutrec->set_prop('MasterPass', $master_pw); |
32 |
+ } |
33 |
+ if (not $slave_pw) |
34 |
+ { |
35 |
+ $slave_pw = "not set due to error"; |
36 |
+ if ( open( RANDOM, "/dev/urandom" ) ) |
37 |
+ { |
38 |
+ my $buf; |
39 |
+ if ( read( RANDOM, $buf, 57 ) != 57 ) |
40 |
+ { |
41 |
+ warn("Short read from /dev/random: $!"); |
42 |
+ } |
43 |
+ else |
44 |
+ { |
45 |
+ $slave_pw = encode_base64($buf); |
46 |
+ chomp $slave_pw; |
47 |
+ } |
48 |
+ close RANDOM; |
49 |
+ } |
50 |
+ else |
51 |
+ { |
52 |
+ warn "Could not open /dev/urandom: $!"; |
53 |
+ } |
54 |
+ $nutrec->set_prop('SlavePass', $slave_pw); |
55 |
+ } |
56 |
+} |
57 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/DEVICE mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/DEVICE |
58 |
--- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/DEVICE 2002-11-18 15:56:32.000000000 -0700 |
59 |
+++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/DEVICE 1969-12-31 17:00:00.000000000 -0700 |
60 |
@@ -1,5 +0,0 @@ |
61 |
-{ |
62 |
-# UPS device - needed if UPS is locally attached |
63 |
- my $device = $nut{Device} || "/var/lib/ups/hiddev0"; |
64 |
- $OUT .= "DEVICE=$device"; |
65 |
-} |
66 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/MODEL mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/MODEL |
67 |
--- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/MODEL 2006-03-15 12:51:21.000000000 -0700 |
68 |
+++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/MODEL 2006-12-21 12:26:19.000000000 -0700 |
69 |
@@ -1,15 +1 @@ |
70 |
-{ |
71 |
-# Model of the UPS (filename to call for it, without path) |
72 |
-# Example - one of |
73 |
-# apcsmart - APC SMartUPS and similar |
74 |
-# fentonups - Fenton UPS |
75 |
-# optiups |
76 |
-# bestups |
77 |
-# genericups |
78 |
-# ups-trust425+625 |
79 |
-# You MUST change this, or set SERVER to "no" |
80 |
- my $model = $nut{Model} || "newhidups"; |
81 |
- |
82 |
- $OUT .= "MODEL=$model"; |
83 |
-} |
84 |
- |
85 |
+MODEL=upsdrvctl |
86 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/OPTIONS mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/OPTIONS |
87 |
--- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/OPTIONS 2002-11-18 15:56:32.000000000 -0700 |
88 |
+++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/OPTIONS 1969-12-31 17:00:00.000000000 -0700 |
89 |
@@ -1,8 +0,0 @@ |
90 |
-{ |
91 |
-# Any options to pass to $MODEL |
92 |
-# ex. for my TrippLite UPS, use |
93 |
-# OPTIONS="-t 5" |
94 |
- my $options = $nut{Options} || ''; |
95 |
- $OUT .= "OPTIONS=$options"; |
96 |
-} |
97 |
- |
98 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/SERVER mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/SERVER |
99 |
--- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/SERVER 2002-11-18 15:56:32.000000000 -0700 |
100 |
+++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/SERVER 2006-12-21 12:26:46.000000000 -0700 |
101 |
@@ -1,3 +1 @@ |
102 |
-{# If the UPS is locally attached set it to "yes" |
103 |
-}SERVER=yes |
104 |
- |
105 |
+SERVER=yes |
106 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/20ACL mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/20ACL |
107 |
--- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/20ACL 2002-11-18 15:56:32.000000000 -0700 |
108 |
+++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/20ACL 2006-12-21 12:44:48.000000000 -0700 |
109 |
@@ -1,2 +1,3 @@ |
110 |
ACL all 0.0.0.0/0 |
111 |
ACL localhost 127.0.0.1/32 |
112 |
+ACL localnet { "$InternalInterface{Network}/$InternalInterface{Netmask}" } |
113 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/40ACCESS mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/40ACCESS |
114 |
--- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/40ACCESS 2006-03-15 12:51:21.000000000 -0700 |
115 |
+++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/40ACCESS 2006-12-21 12:44:57.000000000 -0700 |
116 |
@@ -1,2 +1,3 @@ |
117 |
ACCEPT localhost |
118 |
+ACCEPT localnet |
119 |
REJECT all |
120 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.users/monitor mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.users/monitor |
121 |
--- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.users/monitor 2002-11-19 14:05:50.000000000 -0700 |
122 |
+++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.users/monitor 2006-12-21 13:00:59.000000000 -0700 |
123 |
@@ -1,5 +1,10 @@ |
124 |
- [monuser] |
125 |
- password = mypassword |
126 |
+ [upsmaster] |
127 |
+ password = { $nut{MasterPass} } |
128 |
allowfrom = localhost |
129 |
+ upsmon master |
130 |
+ |
131 |
+ [upsslave] |
132 |
+ password = { $nut{SlavePass} } |
133 |
+ allowfrom = localhost localnet |
134 |
upsmon slave |
135 |
|
136 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/MONITOR mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/MONITOR |
137 |
--- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/MONITOR 2006-03-15 12:51:21.000000000 -0700 |
138 |
+++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/MONITOR 2006-12-21 13:01:32.000000000 -0700 |
139 |
@@ -1 +1 @@ |
140 |
-MONITOR UPS@localhost 1 monuser mypassword slave |
141 |
+MONITOR UPS@localhost 1 upsmaster { $nut{MasterPass} } master |
142 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/NOTIFYMSG mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/NOTIFYMSG |
143 |
--- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/NOTIFYMSG 2006-03-15 12:51:21.000000000 -0700 |
144 |
+++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/NOTIFYMSG 1969-12-31 17:00:00.000000000 -0700 |
145 |
@@ -1 +0,0 @@ |
146 |
-# NOTIFYMSG is set to default |
147 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/RUN_AS_USER mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/RUN_AS_USER |
148 |
--- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/RUN_AS_USER 2006-03-15 12:51:21.000000000 -0700 |
149 |
+++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/RUN_AS_USER 1969-12-31 17:00:00.000000000 -0700 |
150 |
@@ -1 +0,0 @@ |
151 |
-# RUN_AS_USER nutmon |