/[smecontribs]/rpms/smeserver-tftp-server/contribs10/smeserver-tftp-server-1.2-updated-systemd-unit-files.patch
ViewVC logotype

Contents of /rpms/smeserver-tftp-server/contribs10/smeserver-tftp-server-1.2-updated-systemd-unit-files.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon Apr 11 10:14:31 2022 UTC (2 years, 7 months ago) by jcrisp
Branch: MAIN
CVS Tags: smeserver-tftp-server-1_2-10_el7_sme, smeserver-tftp-server-1_2-11_el7_sme, smeserver-tftp-server-1_2-12_el7_sme, smeserver-tftp-server-1_2-13_el7_sme, smeserver-tftp-server--, HEAD
* Mon Apr 11 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 1.2-10.sme
- Update systemd unit files [SME: 11927]
- Migrate db from tftpd to tftp [SME: 11928]

1 diff -ruN smeserver-tftp-server-1.2.old/createlinks smeserver-tftp-server-1.2/createlinks
2 --- smeserver-tftp-server-1.2.old/createlinks 2022-04-04 15:59:16.502537546 +0100
3 +++ smeserver-tftp-server-1.2/createlinks 2022-04-10 17:21:45.862568097 +0100
4 @@ -10,6 +10,8 @@
5 foreach my $file (qw(
6 /etc/systemd/system-preset/49-koozali.preset
7 /etc/hosts.allow
8 + /usr/lib/systemd/system/tftp.service.d/50koozali.conf
9 + /usr/lib/systemd/system/tftp.socket.d/50koozali.conf
10 ))
11 {
12 templates2events( $file, $event );
13 @@ -29,4 +31,5 @@
14 #safe_symlink("/var/service/tftpd", "root/service/tftpd");
15 #service_link_enhanced("tftpd", "S85", "7");
16 #service_link_enhanced("tftpd", "K25", "0");
17 -templates2events("/etc/hosts.allow", qw(tftpd-conf));
18 +
19 +# templates2events("/etc/hosts.allow", qw(tftpd-conf));
20 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/access smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/access
21 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/access 1970-01-01 01:00:00.000000000 +0100
22 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/access 2006-03-20 09:42:00.000000000 +0000
23 @@ -0,0 +1 @@
24 +private
25 \ No newline at end of file
26 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/directory smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/directory
27 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/directory 1970-01-01 01:00:00.000000000 +0100
28 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/directory 2006-03-20 09:44:03.000000000 +0000
29 @@ -0,0 +1 @@
30 +/tftpboot
31 \ No newline at end of file
32 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/log smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/log
33 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/log 1970-01-01 01:00:00.000000000 +0100
34 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/log 2006-03-20 09:42:53.000000000 +0000
35 @@ -0,0 +1 @@
36 +normal
37 \ No newline at end of file
38 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/privilege smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/privilege
39 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/privilege 1970-01-01 01:00:00.000000000 +0100
40 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/privilege 2022-04-04 15:59:05.988365500 +0100
41 @@ -0,0 +1 @@
42 +ro
43 \ No newline at end of file
44 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/status smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/status
45 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/status 1970-01-01 01:00:00.000000000 +0100
46 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/status 2004-03-12 06:44:39.000000000 +0000
47 @@ -0,0 +1 @@
48 +disabled
49 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/timeout smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/timeout
50 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/timeout 1970-01-01 01:00:00.000000000 +0100
51 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/timeout 2022-04-04 15:59:05.988365500 +0100
52 @@ -0,0 +1 @@
53 +default
54 \ No newline at end of file
55 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/type smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/type
56 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/type 1970-01-01 01:00:00.000000000 +0100
57 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/type 2004-03-14 22:13:47.000000000 +0000
58 @@ -0,0 +1 @@
59 +service
60 \ No newline at end of file
61 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/UDPPort smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/UDPPort
62 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/UDPPort 1970-01-01 01:00:00.000000000 +0100
63 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/UDPPort 2006-03-20 09:42:39.000000000 +0000
64 @@ -0,0 +1 @@
65 +69
66 \ No newline at end of file
67 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/user smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/user
68 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftp/user 1970-01-01 01:00:00.000000000 +0100
69 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftp/user 2022-04-04 15:59:05.992365565 +0100
70 @@ -0,0 +1 @@
71 +nobody
72 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/access smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/access
73 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/access 2022-04-04 15:59:16.502537546 +0100
74 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/access 1970-01-01 01:00:00.000000000 +0100
75 @@ -1 +0,0 @@
76 -private
77 \ No newline at end of file
78 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/directory smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/directory
79 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/directory 2022-04-04 15:59:16.502537546 +0100
80 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/directory 1970-01-01 01:00:00.000000000 +0100
81 @@ -1 +0,0 @@
82 -/tftpboot
83 \ No newline at end of file
84 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/log smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/log
85 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/log 2022-04-04 15:59:16.502537546 +0100
86 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/log 1970-01-01 01:00:00.000000000 +0100
87 @@ -1 +0,0 @@
88 -normal
89 \ No newline at end of file
90 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/privilege smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/privilege
91 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/privilege 2022-04-04 15:59:16.502537546 +0100
92 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/privilege 1970-01-01 01:00:00.000000000 +0100
93 @@ -1 +0,0 @@
94 -ro
95 \ No newline at end of file
96 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/status smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/status
97 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/status 2022-04-04 15:59:16.502537546 +0100
98 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/status 1970-01-01 01:00:00.000000000 +0100
99 @@ -1 +0,0 @@
100 -disabled
101 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/timeout smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/timeout
102 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/timeout 2022-04-04 15:59:16.502537546 +0100
103 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/timeout 1970-01-01 01:00:00.000000000 +0100
104 @@ -1 +0,0 @@
105 -default
106 \ No newline at end of file
107 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/type smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/type
108 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/type 2022-04-04 15:59:16.502537546 +0100
109 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/type 1970-01-01 01:00:00.000000000 +0100
110 @@ -1 +0,0 @@
111 -service
112 \ No newline at end of file
113 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/UDPPort smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/UDPPort
114 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/UDPPort 2022-04-04 15:59:16.502537546 +0100
115 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/UDPPort 1970-01-01 01:00:00.000000000 +0100
116 @@ -1 +0,0 @@
117 -69
118 \ No newline at end of file
119 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/user smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/user
120 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/defaults/tftpd/user 2022-04-04 15:59:16.502537546 +0100
121 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/defaults/tftpd/user 1970-01-01 01:00:00.000000000 +0100
122 @@ -1 +0,0 @@
123 -nobody
124 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/migrate/tftpd.v10 smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/migrate/tftpd.v10
125 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/db/configuration/migrate/tftpd.v10 1970-01-01 01:00:00.000000000 +0100
126 +++ smeserver-tftp-server-1.2/root/etc/e-smith/db/configuration/migrate/tftpd.v10 2022-04-11 10:07:40.299370649 +0100
127 @@ -0,0 +1,10 @@
128 +{
129 + my $tftpd = $DB->get("tftpd") or return;
130 +
131 + my $tftp = $DB->get("tftp") ||
132 + $DB->new_record("tftp", { type => "service" });
133 +
134 + $tftp->merge_props($tftpd->props);
135 +
136 + $tftpd->delete;
137 +}
138 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/templates/etc/hosts.allow/tftp smeserver-tftp-server-1.2/root/etc/e-smith/templates/etc/hosts.allow/tftp
139 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/templates/etc/hosts.allow/tftp 1970-01-01 01:00:00.000000000 +0100
140 +++ smeserver-tftp-server-1.2/root/etc/e-smith/templates/etc/hosts.allow/tftp 2022-04-04 16:10:44.308793024 +0100
141 @@ -0,0 +1,3 @@
142 +{
143 + $DB->hosts_allow_spec('tftp', 'in.tftpd');
144 +}
145 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/templates/etc/hosts.allow/tftpd smeserver-tftp-server-1.2/root/etc/e-smith/templates/etc/hosts.allow/tftpd
146 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/templates/etc/hosts.allow/tftpd 2022-04-04 15:59:16.501537530 +0100
147 +++ smeserver-tftp-server-1.2/root/etc/e-smith/templates/etc/hosts.allow/tftpd 1970-01-01 01:00:00.000000000 +0100
148 @@ -1,3 +0,0 @@
149 -{
150 - $DB->hosts_allow_spec('tftpd', 'in.tftpd');
151 -}
152 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.service.d/50koozali.conf/10Unit smeserver-tftp-server-1.2/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.service.d/50koozali.conf/10Unit
153 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.service.d/50koozali.conf/10Unit 1970-01-01 01:00:00.000000000 +0100
154 +++ smeserver-tftp-server-1.2/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.service.d/50koozali.conf/10Unit 2022-04-10 17:29:28.925132153 +0100
155 @@ -0,0 +1,7 @@
156 +
157 +[Unit]
158 +Description=Tftp Server
159 +Requires=tftp.socket
160 +Documentation=man:in.tftpd
161 +After=network-online.target
162 +Wants=network-online.target
163 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.service.d/50koozali.conf/20Service smeserver-tftp-server-1.2/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.service.d/50koozali.conf/20Service
164 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.service.d/50koozali.conf/20Service 1970-01-01 01:00:00.000000000 +0100
165 +++ smeserver-tftp-server-1.2/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.service.d/50koozali.conf/20Service 2022-04-11 10:06:43.155435534 +0100
166 @@ -0,0 +1,48 @@
167 +{
168 + my $blocksize = $tftp{blocksize} || "1468";
169 + my $verbosity = "-v";
170 + my $log = $tftp{log};
171 + my $refuse = $tftp{refuse};
172 + my $privilege = $tftp{privilege} | "";
173 + my $user = $tftp{user} || "";
174 +
175 + # Now only relevant if you run under xinetd
176 + my $timeout = $tftp{timeout} || "";
177 +
178 + if ( $log eq "verbose" ) {
179 + $verbosity = "-vv";
180 + }
181 + elsif ( $log eq "disabled" ) {
182 + $verbosity = "";
183 + }
184 +
185 + if ( $refuse ne "" ) {
186 + $refuse = "-r $refuse";
187 + }
188 +
189 + if ( $blocksize <= "512" ) {
190 + $blocksize = "512";
191 + }
192 + elsif ( $blocksize >= "65464" ) {
193 + $blocksize = "65464";
194 + }
195 +
196 + if ( $privilege eq "rw" ) {
197 + $privilege = "-c";
198 + }
199 +
200 + if ( $user ne "" ) {
201 + $user = "-u $user";
202 + }
203 +
204 + $OUT .= "[Service]\n";
205 + $OUT .= "Options: man in.tftpd\n";
206 + $OUT .= "ExecStartPre=/bin/sleep 10\n";
207 + $OUT .= " \n";
208 + $OUT .= "ExecStart=\n";
209 + $OUT .= "ExecStart=/usr/sbin/in.tftpd -s /tftpboot $verbosity -B $blocksize $user $refuse $privilege\n";
210 + $OUT .= " \n";
211 + $OUT .= "StandardInput=socket\n";
212 +
213 +}
214 +
215 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.service.d/50koozali.conf/30Install smeserver-tftp-server-1.2/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.service.d/50koozali.conf/30Install
216 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.service.d/50koozali.conf/30Install 1970-01-01 01:00:00.000000000 +0100
217 +++ smeserver-tftp-server-1.2/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.service.d/50koozali.conf/30Install 2022-04-10 17:30:00.373645860 +0100
218 @@ -0,0 +1,4 @@
219 +
220 +[Install]
221 +WantedBy=sme-server.target
222 +Also=tftp.socket
223 diff -ruN smeserver-tftp-server-1.2.old/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.socket.d/50koozali.conf/20Socket smeserver-tftp-server-1.2/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.socket.d/50koozali.conf/20Socket
224 --- smeserver-tftp-server-1.2.old/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.socket.d/50koozali.conf/20Socket 1970-01-01 01:00:00.000000000 +0100
225 +++ smeserver-tftp-server-1.2/root/etc/e-smith/templates/usr/lib/systemd/system/tftp.socket.d/50koozali.conf/20Socket 2022-04-11 10:07:16.314978164 +0100
226 @@ -0,0 +1,21 @@
227 +{
228 +
229 + my $interfaceIP = "127.0.0.1";
230 + my $localIP = ${LocalIP};
231 + my $port = $tftp{UDPPort};
232 + my $access = $tftp{access};
233 +
234 + if ( $access eq "public" ) {
235 + $interfaceIP = "0.0.0.0";
236 + }
237 + elsif ( $access eq "private" ) {
238 + $interfaceIP = $localIP;
239 + }
240 +
241 + $OUT .= "[Socket]\n";
242 + $OUT .= "ListenDatagram=\n";
243 + $OUT .= "ListenDatagram=$interfaceIP:$port\n";
244 + $OUT .= "FreeBind=True\n";
245 +
246 +}
247 +
248 diff -ruN smeserver-tftp-server-1.2.old/root/usr/lib/systemd/system/tftp.service.d/50koozali.conf smeserver-tftp-server-1.2/root/usr/lib/systemd/system/tftp.service.d/50koozali.conf
249 --- smeserver-tftp-server-1.2.old/root/usr/lib/systemd/system/tftp.service.d/50koozali.conf 2022-04-04 15:59:16.502537546 +0100
250 +++ smeserver-tftp-server-1.2/root/usr/lib/systemd/system/tftp.service.d/50koozali.conf 1970-01-01 01:00:00.000000000 +0100
251 @@ -1,3 +0,0 @@
252 -[Install]
253 -WantedBy=sme-server.target
254 -
255 diff -ruN smeserver-tftp-server-1.2.old/root/var/service/tftpd/log/run smeserver-tftp-server-1.2/root/var/service/tftpd/log/run
256 --- smeserver-tftp-server-1.2.old/root/var/service/tftpd/log/run 2022-04-04 15:59:16.501537530 +0100
257 +++ smeserver-tftp-server-1.2/root/var/service/tftpd/log/run 1970-01-01 01:00:00.000000000 +0100
258 @@ -1,25 +0,0 @@
259 -#!/bin/sh
260 -
261 -#----------------------------------------------------------------------
262 -# copyright (C) 2003 Mitel Networks Corporation
263 -#
264 -# This program is free software; you can redistribute it and/or modify
265 -# it under the terms of the GNU General Public License as published by
266 -# the Free Software Foundation; either version 2 of the License, or
267 -# (at your option) any later version.
268 -#
269 -# This program is distributed in the hope that it will be useful,
270 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
271 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
272 -# GNU General Public License for more details.
273 -#
274 -# You should have received a copy of the GNU General Public License
275 -# along with this program; if not, write to the Free Software
276 -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
277 -#
278 -# Technical support for this program is available from Mitel Networks
279 -# Please visit our web site www.mitel.com/sme/ for details.
280 -#----------------------------------------------------------------------
281 -exec \
282 - /usr/local/bin/multilog t s5000000 \
283 - /var/log/tftpd
284 diff -ruN smeserver-tftp-server-1.2.old/root/var/service/tftpd/run smeserver-tftp-server-1.2/root/var/service/tftpd/run
285 --- smeserver-tftp-server-1.2.old/root/var/service/tftpd/run 2022-04-04 15:59:16.501537530 +0100
286 +++ smeserver-tftp-server-1.2/root/var/service/tftpd/run 1970-01-01 01:00:00.000000000 +0100
287 @@ -1,82 +0,0 @@
288 -#!/bin/bash
289 -
290 -#db configuration show tftpd
291 -#Database: configuration
292 -#Key: tftpd
293 -#PROP: status VALUES: enabled/disabled
294 -#PROP: access VALUES: private/public/localhost
295 -#PROP: log VALUES: normal/verbose/disabled
296 -#PROP: user VALUES: root/nobody (or any other valid user)
297 -#PROP: privelege VALUES: ro/rw
298 -#PROP: timeout: VALUES: default/300 (secounds, 900 is the default)
299 -#PROP: UDPPort: VALUES: 69
300 -#PROP: directory VALUES: /tftpboot (or any other directory)
301 -#PROP: refuse VALUES: <tftp-option> (any tftp option that you need to disable)
302 -
303 -TFTPD_STATUS=$(/sbin/e-smith/db configuration getprop tftpd status);
304 -if [ $TFTPD_STATUS == "enabled" ]; then
305 - TFTPD_ACCESS=$(/sbin/e-smith/db configuration getprop tftpd access);
306 - TFTPD_LOG=$(/sbin/e-smith/db configuration getprop tftpd log);
307 - TFTPD_USER=$(/sbin/e-smith/db configuration getprop tftpd user);
308 - TFTPD_PRIVILEGE=$(/sbin/e-smith/db configuration getprop tftpd privilege);
309 - TFTPD_TIMEOUT=$(/sbin/e-smith/db configuration getprop tftpd timeout);
310 - TFTPD_UDPPORT=$(/sbin/e-smith/db configuration getprop tftpd UDPPort);
311 - TFTPD_DIRECTORY=$(/sbin/e-smith/db configuration getprop tftpd directory);
312 - TFTPD_REFUSE=$(/sbin/e-smith/db configuration getprop tftpd refuse);
313 - TFTPD_BLKSIZE=$(/sbin/e-smith/db configuration getprop tftpd blksize);
314 -
315 - # If BLKSIZE is set
316 - if [ ! -z $TFTPD_BLKSIZE ]; then
317 - #echo "Block size $TFTPD_BLKSIZE"
318 - if [ "$TFTPD_BLKSIZE" -le "512" ] ; then
319 - TFTPD_BLKSIZE=1500;
320 - elif [ "$TFTPD_BLKSIZE" -ge "65464" ] ; then
321 - TFTPD_BLKSIZE=65464;
322 - fi
323 - #echo "Now we have $TFTPD_BLKSIZE"
324 - fi
325 - #echo "Block size is $TFTPD_BLKSIZE"
326 -
327 - TFTPD_ACCESS_SETTING="127.0.0.1";
328 - if [ $TFTPD_ACCESS == "public" ]; then
329 - TFTPD_ACCESS_SETTING="0.0.0.0";
330 - elif [ $TFTPD_ACCESS == "private" ]; then
331 - TFTPD_ACCESS_SETTING=$(/sbin/e-smith/db configuration get LocalIP);
332 - fi
333 -
334 - TFTPD_LOG_SETTING="-v";
335 - if [ $TFTPD_LOG == "verbose" ]; then
336 - TFTPD_LOG_SETTING="-vv";
337 - elif [ $TFTPD_LOG == "disabled" ]; then
338 - TFTPD_LOG_SETTING="";
339 - fi
340 -
341 - TFTPD_PRIVILEGE_SETTING=""
342 - if [ $TFTPD_PRIVILEGE == "rw" ]; then
343 - TFTPD_PRIVILEGE_SETTING="-c";
344 - fi
345 -
346 - TFTPD_TIMEOUT_SETTING=""
347 - if [ $TFTPD_TIMEOUT != "default" ]; then
348 - TFTPD_TIMEOUT_SETTING="-t $TFTPD_TIMEOUT";
349 - fi
350 -
351 - TFTPD_REFUSE_SETTING=""
352 - if [ "$TFTPD_REFUSE" != "" ]; then
353 - TFTPD_REFUSE_SETTING="-r $TFTPD_REFUSE";
354 - fi
355 -
356 - TFTPD_BLKSIZE_SETTING=""
357 - if [ "$TFTPD_BLKSIZE" != "" ]; then
358 - TFTPD_BLKSIZE_SETTING="-B $TFTPD_BLKSIZE";
359 - fi
360 -
361 - cd /
362 - exec 2>&1
363 - exec udpsvd -h $TFTPD_LOG_SETTING \
364 - $TFTPD_ACCESS_SETTING $TFTPD_UDPPORT \
365 - in.tftpd $TFTPD_LOG_SETTING $TFTPD_PRIVILEGE_SETTING \
366 - -u $TFTPD_USER $TFTPD_TIMEOUT_SETTING $TFTPD_REFUSE_SETTING $TFTPD_BLKSIZE_SETTING -s $TFTPD_DIRECTORY
367 -else
368 - /usr/bin/runsvctrl down .
369 -fi

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed